0
따라서이 파일은 2 개의 서비스 상태를 확인하고 실행되지 않는 것으로 확인되면 시작합니다. 첫 번째 서비스에서는 잘 작동하지만 둘 이상의 서비스에서는 어떻게 작동합니까? 또한 시작한 후 상태 확인을 수행 할 수 있기를 원합니다. 당신의 생각을 저에게 말 해주세요.서비스의 Windows 배치 파일
net start | find "spooler" > nul 2>&1
if not .%errorlevel%.==.0. goto spoolersvc
goto nextSvc
:nextSvc
net start | find "BITS" > nul 2>&1
if not .%errorlevel%.==.0. goto BITSsvc
goto quit
:spoolersvc
net start "spooler"
echo spooler Service restarted at %TIME::=-% on %DATE:/=-% >> C:\scripts\isa\logs\spooler.log
echo
:BITSsvc
net start "BITS"
echo Microsoft BITS Service restarted at %TIME::=-% on %DATE:/=-% >> C:\scripts\isa\logs\BITS.log
echo
:quit
exit
감사합니다. @ shf301. 스크립트 실행을 시도했지만 서비스가 시작되지 않았습니다. 다시 확인하고 제가 누락 된 부분을 알려주십시오. 감사. – Karthik