0

I accidentally removed my Apache windows service trying to install another Apache web server. Does anyone know how I can create another Apache windows service from cmd? I tried "sc create ..." but I am missing a script on the end like -k start? Not sure what I need for the end of it...

I am running Apache 2.2

Thank you

2 Answers 2

2

You can put the arguments for the service on the "binPath" argument on your "sc" command, escaping any quotes with slashes. For example, if you wanted to run: "C:\Program Files\foo\bar.exe" -service

sc create service_name binpath= "\"C:\Program Files\foo\bar.exe\" -service"

Look at the resulting service entry in HKLM\System\CurrentControlSet\Services\service_name and see if the ImagePath value looks like you want it to.

1
  • thank you for your reply. it gave me an error saying it could not be started in time. Error code 1?
    – Jared
    Oct 23, 2009 at 20:09
0

The Apache2.2 service can be re-created with the bin\httpd.exe -k install command. Then started with the bin\httpd.exe -k start command.

You must log in to answer this question.