For instance - to check the Messenger service on a remote computer (you obviously need the correct rights on the remote machine);
sc \\
type service_state.txt | find "4"
IF ERRORLEVEL 255 GOTO Running
IF ERRORLEVEL 1 GOTO Problem
:Running
echo Service is running
goto end
:Problem
echo Service Problem
goto End
:End
exit
Thought this may be worth posting if someone's having a hard time with errorlevels!
No comments:
Post a Comment