Install Application as Service on Windows Server 2008

You can use the sc.exe command to install an EXE as a service on Windows Server 2008. There’s a good article on creating an application that can easily run as either a console app or as a service here. From an administrator command prompt, the syntax is something like this:

scservernamecreate MyService.ServiceName binpath= d:servicesFooFoo.exe displayname= MyService.ServiceName

Note that for this particular utility, the command line options include the “=” sign in them, so you must have no space before the"=" and you must have a space after the"=". Also the server name must be preceded by to work.

Assuming it works, you should see something like this:

As you can see from the help message above, the SC.EXE utility can be used for much more than simply creating services, but this is something I’ve had to use it for more than once (and hence I’m blogging it since it’s not necessarily easy to search for).

If you liked this post, consider subscribing to email updates about my new posts, or sharing it on Hacker News.

Keyboard shortcuts

?
Show this help
Esc
Close this help or an open menu
n
Next (newer) post: RazorEngine Performance and Template Caching
p
Previous (older) post: Getting Started with WebMatrix 2
Tab
Move between links and buttons (Shift+Tab to go back)