0

How do I install an exe as a windows service with start parameters? I'm using sc.exe CREATE but can't find how to add start parameters to it.

I've also tried using nssm but can't find how to set start parameters there either.

Everything has to be done using the command prompt

I'm currently trying to use:

sc CREATE test binPath= "\"C:\a.exe\" --run -c \"C:\a.config"

But when trying to run it I get: The service did not respond to the start or control request in a timely fashion.

  • I think you forgot the last double-quote: sc CREATE test binPath= "\"C:\a.exe\" --run -c \"C:\a.config\"" – Daniel Jan 13 '16 at 7:00
  • @Daniel same answer – President Camacho Jan 13 '16 at 7:02
1

Not all exe files can be run as services. It's not like an autorun. For example CALC.EXE:

C:\WINDOWS\system32>sc create CALC binpath= "%WINDIR%\system32\calc.exe"
[SC] CreateService SUCCESS

C:\WINDOWS\system32>sc start CALC
[SC] StartService FAILED 1053:

The service did not respond to the start or control request in a timely fashion.
  • Thanks, I noticed that I had to write some code inside the .exe to support service. – President Camacho Jan 13 '16 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.