Hello,
I have this vbs script which should install a new service, but it doesn't work. Can anyone tell me what's wrong in this script.
Here's the script:
Const OWN_PROCESS = 16
Const NOT_INTERACTIVE = False
Const NORMAL_ERROR_CONTROL = 2
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & _
"{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2"
Set objService = objWMIService.Get("Win32_BaseService"
errReturn = objService.Create("MyService", _
"My service test", _
"c:\test\my.exe", _
OWN_PROCESS, _
NORMAL_ERROR_CONTROL, _
"Manual", _
NOT_INTERACTIVE, _
"NT AUTHORITY\LocalService", ""
Wscript.Echo errReturn
Thanks!
I have this vbs script which should install a new service, but it doesn't work. Can anyone tell me what's wrong in this script.
Here's the script:
Const OWN_PROCESS = 16
Const NOT_INTERACTIVE = False
Const NORMAL_ERROR_CONTROL = 2
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & _
"{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2"
Set objService = objWMIService.Get("Win32_BaseService"
errReturn = objService.Create("MyService", _
"My service test", _
"c:\test\my.exe", _
OWN_PROCESS, _
NORMAL_ERROR_CONTROL, _
"Manual", _
NOT_INTERACTIVE, _
"NT AUTHORITY\LocalService", ""
Wscript.Echo errReturn
Thanks!