Check if a process is not running to then run it on Windows

Asked

Viewed 41 times

0

would like to check if a process is active in windows and if not run it automatically as it is a dedicated server and sometimes falls.

I thought I’d run the script from time to time in the scheduler.

the process name is servertet.exe

Thanks in advance for the help!

1 answer

0

Thinking about the solution of your problem, recommend running the application as windows service, this way you can configure to start automatically, and if your application comes to fall even with the server turned on, windows service takes care to restart.

Thus, one of the options is NSSM http://nssm.cc/usage.

Download the above website application (is Free) and put in the same folder as your exe.

Then log in to the windows console (cmd), go to the folder that downloaded the file and type:

nssm install servertet

A window will be opened to inform the service parameters, enter the data:

In the Path field, find the servertet.exe file

In the Startupdirectory field leave it the way it filled in, if you want (and know), you can fill in the other fields of the other tabs.

Click Installservice and the service will be installed.

From this moment servertet becomes controlled as a windows service normally.

OBS.: Remember to close the servertet.exe and start as windows service, and test before putting into production.

  • Thanks for the quick reply buddy! I will try this method, until pq the server runs through a bat file.

  • Did it work? If so, could you mark the question as answered? When in doubt, visit the [tour] to find out how to do it. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.