08-16-2009 06:10 PM
Hello,
I am using SystemExec.vi to run a batch file using LabVIEW. Currently, I have "Wait until finished" set to True and "run minimized" set to False.
The batch file starts when the VI is run and VI keeps running until the batch file is stopped through "Ctrl-C". Stopping the VI, however, does not stop the batch file.
I was wondering if there was a way to stop the batch file through LabVIEW by sending "Ctrl-C". Comments/suggestions are appreciated.
Thanks!
08-16-2009 06:58 PM
08-16-2009 08:37 PM
Thanks.
I am able to stop the batch file using the virtual keys if the cmd window is at the top.
I read few posts about a VI called "Move Window to the top.vi" which could be used to ensure the cmd window position at the top. Posted links were broken though. I will keep looking on the web and on NI website. However, if you happen to know about anything related, please let me know. Thank you.
08-16-2009 09:03 PM
Did you mean 'Bring to Front' ?
For the application, you can input: cmd.exe
Then just use an Invoke Node to move it to the front.
You could do this:
1) Move cmd.exe to the front
2) Use the Ctrl-C command
3) Move your VI back to the front
08-17-2009 06:59 AM
Cory's idea would be the way to go since those are native LV functions.
In order to use (and have) "Move Window to the top.vi" you need the LVWUtil32.dll and associated libs, located here. The functions in these libs use API calls.