Sunday, May 8, 2011

Search for Running Process and Start It if It Is not Found

It is quite a common task to start some processes in an automatic way. Of course we usually have no need to run many instances of the application simultaneously, thus we have to check running processes first. Fortunately, batch files are pretty useful in this case and let us solve the problem in a fast and simple way. The solution will look like:
tasklist | findstr /i yourapp.exe 1>nul || start "" "C:\Program Files\Megacorp Inc\yourapp.exe"
You can easily modify this single-line script with the help of our award-winning batch file editor or send your questions and suggestions to us.

No comments:

Post a Comment

Translate