LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Press any key to end an DOS exe run in system.exe VI

Solved!
Go to solution

Hi I am executing a couple old DOS based exe programs.  Two programs that run one after the other then loop and do it over again (variables are changed each loop)  The first exe program  requires the user to "press any Key" to terminate it (close the CMD window.  When I run my VI using the system.exe sub-VI to run the DOS programs I have to "press any key" to close the window and allow my VI to continue looping.  Or if I use the "Wait until completion" option I end up with a bunch of CMD windows to close at the end.  There must be a simple way to "fake a key hit"  Plan B is to train a small monkey to sit infront of the key board......

I using Labview 2013 on windows XP / 7

 

 

thanks

0 Kudos
Message 1 of 4
(3,653 Views)

Hi Kman,

 

you mean this one?

😄 Sorry, cheap joke at your expense…

Ever heard of AutoIT?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(3,633 Views)
Solution
Accepted by topic author Kman

Check out this post.  If that doesn't work for you, you can try using SendKey in a Powershell script.  Good luck.

 

Full disclosure, I have done neither of these, so cannot vouch for their usefulness.

0 Kudos
Message 3 of 4
(3,629 Views)

Many thanks, that did the trick, I just used the Keyup VI and used one of the random keys it used, added a smalll delay so the DOS program could finish! - the Monkey can go back to the pet store, he could never find that "Any Key" button anyway!

0 Kudos
Message 4 of 4
(3,609 Views)