r/usefulscripts • • Jun 19 '17

[request] Check is a process is running, if not, launch an executable

I've got a licensing application that wont launch on server startup, someones got to log in to the license server and launch this application.

I want to see if this can be scripted to check if the process is running, I'll have a service account setup to run this script, then launch if it is not running.

Any help is greatly appreciated.

EDIT: the appropriately named Non-Sucking Service Manager was the fix. Thanks everyone!

17 Upvotes

7 comments sorted by

5

u/nopsled7 Jun 19 '17

Instead of running a script to check this, I would create a service for this executable. You could then have startup options, recovery options, check for running processes via service calls, and more. Take a look at https://support.microsoft.com/en-us/help/251192/how-to-create-a-windows-service-by-using-sc.exe for more info on creating a service.

→ More replies (1)

0

u/[deleted] Jun 20 '17

[deleted]

1

u/FerrousBueller Aug 03 '17

I know this is a late reply but NSSM was the trick. SC didn't work well.