quote:
Originally posted by MeEtc
Having a problem with the second half of the script with synergys.exe. The batch file won't continue running because synergys.exe is still running. ultramon.exe won't start until synergys.exe stops. Any way around that?
What second half? What you mean by "synergys is still running"? You mean taskkill doesnt kill the synergys process ?
I ask this because it makes little sense that by adding START to everything it all of a sudden does work. Because you should not explicitly need the START command to start a program!
You only explicitly need START if you want to alter the console window like the title, minimized state, change the priority, wait for the app to quit, etc...
It should work perfectly without it, provided taskkill does kill the process in time. For that reason, and only that reason, it might be a good idea to build in a wait period before running
"c:\program files\ultramon\ultramon.exe" /e so that taskkill has some time to kill the synergys process.
As that is the problem from what I understand from your post.
So, simply adding START like Jarod said doesn't make any difference and wont fix anything and you will most likely experience the same problem another time (when taskkill needs some more time than instant for whatever reason to kill synergys).
So instead of adding START everywhere, try to change:
taskkill /f /t /im synergys.exe
to
start /wait taskkill /f /t /im synergys.exe
this should pause the batch until taskkill has done its job instead of immediatly executing the next line (starting ultramon).