Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Set objShell = Wscript.CreateObject("WScript.Shell")
On Error Resume Next
strComputer = InputBox("Start Service On Remote Computer")
'Check if service is Running
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colRunningServices = objWMIService.ExecQuery ("Select * from Win32_Service Where Name = 'DcomLaunch'")
For Each objItem In colRunningServices
If objItem.State="Stopped" Then
Call SetManStart
Else
wscript.quit
End If
Next
Sub SetManStart
'Set service to Manual
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServicesState = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='DcomLaunch'")
For Each objService in colServicesState
objService.ChangeStartMode("AUTO")
wscript.sleep 5000
'Start service
If objService.State="Stopped" then
objService.StartService()
wscript.sleep 2000
End If
Next
End Sub