@echo off
Echo. > c:\dir\sstate.txt
Echo Stopping service on all servers
sc \\servername stop servicename> nul
Echo Waiting 10 seconds
CHOICE /N /C YN /T 10 /D Y
Echo Starting service on all servers
sc start service > nul
sc \\servername start servicename > nul
Echo Waiting 10 seconds
CHOICE /N /C YN /T 10 /D Y
Echo servername >> c:\dir\sstate.txt
sc \\servername interrogate servicename >> c:\dir\sstate.txt
if defined batch goto :EOF
notepad c:\dir\sstate.txt
Echo. > c:\dir\sstate.txt
Echo Stopping service on all servers
sc \\servername stop servicename> nul
Echo Waiting 10 seconds
CHOICE /N /C YN /T 10 /D Y
Echo Starting service on all servers
sc start service > nul
sc \\servername start servicename > nul
Echo Waiting 10 seconds
CHOICE /N /C YN /T 10 /D Y
Echo servername >> c:\dir\sstate.txt
sc \\servername interrogate servicename >> c:\dir\sstate.txt
if defined batch goto :EOF
notepad c:\dir\sstate.txt
Comments
Post a Comment