with this, i can get the result according to the state of WebClient, that means we can find the Service and get its state correctly
service = "WebClient"
Set wmi = GetObject("winmgmts:\\.\root\cimv2")
qry = "SELECT * FROM Win32_Service WHERE Name='" & service & "'"
For Each s In wmi.ExecQuery(qry)
If s.State = "Stopped" Then WScript.Echo "stop"
If s.State = "Running" Then WScript.Echo "start"
Next
but why does it not function to do the stop / start?? no return value, nothing>>>>>>
service = "WebClient"
Set wmi = GetObject("winmgmts:\\.\root\cimv2")
qry = "SELECT * FROM Win32_Service WHERE Name='" & service & "'"
For Each s In wmi.ExecQuery(qry)
If s.State = "Stopped" Then s.StartService
If s.State = "Running" Then s.StopService
Next
I appreciate your reply , thank you!!