A
Antti H
Hello,
I am trying to improve our script that controls some services on our
W2003 server.
My goal is to determine in the batch file if the service actually goes
down/up as supposed.
See:
<
E:\test>net stop spooler
The Print Spooler service is stopping.
The Print Spooler service was stopped successfully.
E:\test>tasklist /SVC | find /C "Spooler"
0
E:\test>echo %ERRORLEVEL%
0
errorlevel should be 1 instead of 0 ,no?
If i could set the output of find to a variable, i would have no problem
checking if %variable%==0 or similar. Is there any way to set variables
with the output of a command inside batch, using only windows tools?
Thank you all very much in advance,
Antti H
PS: Can anyone recommend a book that is useful as a command reference
with examples for windows servers?
I am trying to improve our script that controls some services on our
W2003 server.
My goal is to determine in the batch file if the service actually goes
down/up as supposed.
See:
<
E:\test>net stop spooler
The Print Spooler service is stopping.
The Print Spooler service was stopped successfully.
E:\test>tasklist /SVC | find /C "Spooler"
0
E:\test>echo %ERRORLEVEL%
0
errorlevel should be 1 instead of 0 ,no?
If i could set the output of find to a variable, i would have no problem
checking if %variable%==0 or similar. Is there any way to set variables
with the output of a command inside batch, using only windows tools?
Thank you all very much in advance,
Antti H
PS: Can anyone recommend a book that is useful as a command reference
with examples for windows servers?