Share via


How can I run a command line asynchronously?

Question

Monday, September 16, 2013 5:23 PM

Hello,

How can I run a command line program that keeps running in the background while the rest of the TS continues? I've written a little network status program (our network here is sometimes a problem during our builds) that I would like running in the top corner of the screen during the build.  How can I run the program and NOT have the TS engine wait for its completion?

All replies (2)

Monday, September 16, 2013 6:06 PM âś…Answered | 1 vote

You could use a batch that starts your program using "start yourprogram.exe" instead of "start /wait yourprogram.exe" - or whatever mechanism that starts a process and does not wait for it to finish.

Torsten Meringer | http://www.mssccmfaq.de


Monday, September 16, 2013 6:05 PM | 1 vote

You should be able to use the START command (without the WAIT parameter) from cmd:

cmd /c START myexe.exe

I would typically put this in a batch file also so I could use %~dp0 and not have to worry about the current working directory:

cmd /c START %~dp0myexe.exe

Jason | http://blog.configmgrftw.com