I am attempting to send a Windows service a command. I'm trying to use service.UserServiceControl(128) and am receiving a result of 21. Does anyone know what this error means and what I'm doing wrong. The script is below.
Set winServices = GetObject("WinMgmts:".InstancesOf("Win32_BaseService"
for each service in winServices
if service.Name = "TheService" then
if service.State = "Running" then
res = service.UserControlService(128)
end if
end if
next
MsgBox(res)
Set winServices = GetObject("WinMgmts:".InstancesOf("Win32_BaseService"
for each service in winServices
if service.Name = "TheService" then
if service.State = "Running" then
res = service.UserControlService(128)
end if
end if
next
MsgBox(res)