eawedat
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 7/30/2011
-
Status: offline
|
Error 1053: Service does not start
Saturday, July 30, 2011 7:23 AM
( permalink)
I have an exe that I compiled and wanted to run it as a service! now I used the built-in command "sc" to create a service of my executable file! and it succeeded! the thing is when I try to "start" the service I get this error! Could not start the usb2 service on Local Computer. Error 1053: The service did not respond to the start or control request in a timely fashion. thanks a lot.
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: online
|
Re: Error 1053: Service does not start
Sunday, July 31, 2011 4:53 PM
( permalink)
Not a lot that we can do without seeing the code.
|
|
|
|
eawedat
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 7/30/2011
-
Status: offline
|
Re:Error 1053: Service does not start
Sunday, July 31, 2011 9:05 PM
( permalink)
Yes I understand that, the code below creates a service of any exe , code works fine and service would be created,, the only problem when I start the service! I get error message as mentioned above! 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("usb2", _
"usb2", _
"c:\usb2.exe", _
OWN_PROCESS, _
NORMAL_ERROR_CONTROL, _
"Automatic", _
NOT_INTERACTIVE, _
"NT AUTHORITY\LocalService", "") thanks.
|
|
|
|
59cobalt
-
Total Posts
:
969
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: offline
|
Re:Error 1053: Service does not start
Monday, August 01, 2011 12:23 AM
( permalink)
Please do NOT run interactive services with elevated privileges. That kind of thing is a disaster waiting to happen. See MSKB article 327618.
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: online
|
Re:Error 1053: Service does not start
Monday, August 01, 2011 2:05 AM
( permalink)
Well from the error and from your description of the issue I suspect that the problem is in the code of the exe, not the vbscript. That is the code that I am talking about. As you say the vbscript appears to be making the service entry, but the exe code is not responding to the service start.
|
|
|
|
eawedat
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 7/30/2011
-
Status: offline
|
Re:Error 1053: Service does not start
Monday, August 01, 2011 2:14 AM
( permalink)
this is the code of the executable file: 'Version 1 works good:)
strComputer = "." '(Any computer name or address)
Set wmi = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set wmiEvent = wmi.ExecNotificationQuery("select * from __InstanceOperationEvent within 1 where TargetInstance ISA 'Win32_PnPEntity' and TargetInstance.Description='USB Mass Storage Device'")
While True
Set usb = wmiEvent.NextEvent()
Select Case usb.Path_.Class
'USB is found
Case "__InstanceCreationEvent" WScript.Echo("USB device found")
'USB is removed
Case "__InstanceDeletionEvent" WScript.Echo("USB device removed")
''Case "__InstanceModificationEvent" WScript.Echo("USB device modified")
End Select
Wend
|
|
|
|