LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SystemExec Command Line (Ctrl-C)

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!

 

0 Kudos
Message 1 of 5
(4,792 Views)
Sounds a lot like this
Richard






0 Kudos
Message 2 of 5
(4,773 Views)

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.

 

 

 

0 Kudos
Message 3 of 5
(4,751 Views)

Did you mean 'Bring to Front' ? 

bring to front.png
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

 

Cory K
Message 4 of 5
(4,745 Views)

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.

 

 

Richard






Message 5 of 5
(4,709 Views)