MyBB Community Forums

Full Version: Batch File Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone,

I need to know a code for a batch file which will check if a process is running on the computer, and if it isn't, to make it restart the process/program.

Any ideas on the code I would need to use?


Thanks.
I might have some thing actually bear with me a min (moving to pc rather than iPod touch :p)
I have a code which does work for executables, but I just realised I need one to check if a batch file is running, and restart a batch if it isn't...
I had to use this code to kill explorer to let Age of Empires run (very strange workaround I know).
Hope this helps though.

taskkill /F /IM filename.bat
filename.bat

Obviously though this one doesn't check it just restarts it no matter what, the batch file would also need to be in the same directory as the other batch file for this to work :p
I had a bat doing this once ( checking), for a game server that was started via opening lots of bats Smile I can't for the life of me find that file!