Install a Windows service using a Windows command prompt?

Vikash Pandey picture Vikash Pandey · Nov 17, 2011 · Viewed 654.6k times · Source

I want to install a Windows service using a Windows command prompt (not the Visual Studio command prompt).

How do I do this?

Answer

hcb picture hcb · Nov 17, 2011

Navigate to the installutil.exe in your .net folder (for .net 4 it's C:\Windows\Microsoft.NET\Framework\v4.0.30319 for example) and use it to install your service, like this:

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe" "c:\myservice.exe"