• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Batch file - check if service is running every 5 minutes, if not start it

Trey22

Diamond Member
Here is what I have so far. I just need this to check if the service is running, and if so, leave it be, but if it's not, to start it up. I'd like this check to happen every 5 minutes or so.

Thanks in advance.

:start
echo %date% %time% >> servicecheck.log
net start | find "doorsnxtsvr" >> servicecheck.log 2>>&1
if not .%errorlevel%.==.0. goto trouble

sleep 300
goto start

:trouble
net start "doorsnxtsvr"
 
Originally posted by: bsobel
Why not set the recovery parameters for the service and be done with it?

That would be much better than the batch script IMO. Set the recovery parameters to restart the service.
 
Originally posted by: KLin
Originally posted by: bsobel
Why not set the recovery parameters for the service and be done with it?

That would be much better than the batch script IMO. Set the recovery parameters to restart the service.

Original question was if the script looked like it would do the job... especially the sleep parameter, which wasn't working for me.

Thx for the other ideas, I guess there are easier ways to accomplish this.

Cheers,

Trey
 
Back
Top