0
sComputer = "."
Set Runninglist = CreateObject("System.Collections.ArrayList")
aTargetSvcs= Array ("pageserver","CacheServer","CrystalAPS","CrystalInputFileServer","CrystalOutputFileServer","CrystalReportApplicationServer", "JobServer_Report")
Set oWMIService = GetObject("winmgmts:" & "{impersonationlevel=impersonate}!\\" _
& sComputer & "\root\cimv2")
Set cServices = oWMIService.ExecQuery("SELECT * FROM Win32_Service")
For Each oService In cServices
For Each sTargetSvc In aTargetSvcs
If LCase(oService.Name) = LCase(sTargetSvc) Then
If oService.State <> "Started" Then
Runninglist.Add oService.Name
oService.StopService()
End If
End if
Next
Next
WScript.Sleep 3000
For Each oService In cServices
For Each sTargetSvc In Runninglist
If LCase(oService.Name) = LCase(sTargetSvc) Then
oService.StartService()
End If
Next
Next
목표 :
CrystalAPS
크리스탈 입력 파일 리포지토리 서버
크리스탈 : 나는 그들이 이전에 중지 된 경우에만이 순서 Runninglist에서 서비스를 시작하려면 출력 파일 리포지토리 서버
크리스탈 보고서 응용 프로그램 서버
크리스탈 보고서 작업 서버
크리스탈 캐시 서버
크리스탈 페이지 서버시작/중지 서비스 이전에 실행 한 경우에만
저장할 수 있습니다
- VBScript를 사전 항목의 안정적 질서를 유지 :
그 서비스들 간의 종속성을 정의하는 것이 어떨까요? –