got this script to stop start services
---
On Error Resume Next
'start with getting the local computer name
strComputer = "."
'now stop the services
Set objWMI = getobject("winmgmts://" & strComputer)
StopService ("Spooler")
WScript.Sleep 3000
StartService ("Spooler")
'sub to stop the services
Sub StopService (ServiceName)
queryString = "select state from win32_service " _
& "where displayname='"& ServiceName & "'"
set results = objWMI.execquery(queryString)
for each service in results
if service.state = "Running" then
service.stopService
end if
next
End Sub
'sub to start the services
Sub StartService (ServiceName)
queryString = "select state from win32_service " _
& "where displayname='"& ServiceName & "'"
set results = objWMI.execquery(queryString)
for each service in results
if service.state <> "Running" then
service.startService
end if
next
End Sub
=========================
U guys able to help me to be able to just add multiple machine in the list and a result if it successfully run in txt file
Thanks
---
On Error Resume Next
'start with getting the local computer name
strComputer = "."
'now stop the services
Set objWMI = getobject("winmgmts://" & strComputer)
StopService ("Spooler")
WScript.Sleep 3000
StartService ("Spooler")
'sub to stop the services
Sub StopService (ServiceName)
queryString = "select state from win32_service " _
& "where displayname='"& ServiceName & "'"
set results = objWMI.execquery(queryString)
for each service in results
if service.state = "Running" then
service.stopService
end if
next
End Sub
'sub to start the services
Sub StartService (ServiceName)
queryString = "select state from win32_service " _
& "where displayname='"& ServiceName & "'"
set results = objWMI.execquery(queryString)
for each service in results
if service.state <> "Running" then
service.startService
end if
next
End Sub
=========================
U guys able to help me to be able to just add multiple machine in the list and a result if it successfully run in txt file
Thanks