Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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.

share|improve this answer
thank you for your reply. it gave me an error saying it could not be started in time. Error code 1? – Jared Oct 23 '09 at 20:09

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.