Answer the question
In order to leave comments, you need to log in
Process Watcher for Windows?
There is Windows Server 2003 R2, on it, among other things, a certain program is running, its exe-file is visible in the list of processes, this is not a service. But sometimes, say, once a month it flies. This is very unpleasant, it is not difficult to restart it, but you have to constantly watch it manually. Tell me a software that would monitor the process and restart it if it is gone.
Answer the question
In order to leave comments, you need to log in
You can use such a VBS script, it’s simple of course, but it once worked for me.
Set WshShell = WScript.CreateObject("WScript.Shell")
Do
WshShell.Run "someprogramm.exe", 1, True
Loop Until False
autorestart.cmd:
If you add output redirection to a file, there will be a log of restarts.
If you need to close the program, you must first close the cmd window.
@echo off
:loop
echo %DATE% %TIME% - Launching program...
start /wait program.exe
goto loop
A similar question was raised recently.
Try what was advised here:
habrahabr.ru/qa/14610/
Do not forget to add some sleep 1000 to the scripts suggested above / below. This way you will save just a bunch of resources. If you do not add it, then the computer will check whether the program is running dozens of times per second, taking up _all_ available resources with this thankless task.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question