make a service with sc.exe
Posted on 2007-10-18
Can someone show me WORKING SAMPLE SYNTAX to turn a exe into a service with the sc.exe utility?
I turned a batch file into a exe with a bat2exec utility, but no dice on getting it to run as a service.
::simple bat contents
:: trying to create it so the DOS window is always showing:
C:\>sc create newservice binpath= c:\windows\again.exe type= interact start= auto obj= %computername%\user password= abc-123
[SC] CreateService FAILED 87:
:: trying again using MS's own sample syntax...
c:\>sc create newservice2 binpath= c:\windows\again.exe
[SC] CreateService2 SUCCESS
c:\>net start newservice2
System error 5 has occurred.
Access is denied.
::fine, I'll be more explicit:
c:\>sc create newservice3 binpath= c:\windows\again.exe type= share start= auto obj= user password= abc-123
[SC] CreateService3 SUCCESS
c:\>net start newservice3
System error 1069 has occurred.
The service did not start due to a logon failure.
I give up.