Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with call to UserServiceControl

Status
Not open for further replies.

jjswanson

Programmer
Jul 11, 2002
1
US
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)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top