Run a Program as a Service

0 Comments

If you have ever wanted to run an application automatically when your computer boots up, but not have it interfere with you running applications, then a service is for you. Most people are not aware that you can run a program as a service and remove it from your normal desktop environment. Why you ask, well the main reason is to have said application continuously run and be managed by the robust Windows Service system. This means the application can be automatically restarted or have actions taken when it fails/crashes.

Install

To get this working, you will need to download and install the Windows Server 2003 Resource Kit Tools. Please take note of where it installs as you will need it later. Once this is installed, I recommend you copy the srvany.exe file from the installed directory and place it directly into the C:\Windows directory, just for ease of access.

Create the Service

Now we need to create the service entry, from a command prompt we want to run the following command, remember to replace [SERVICE NAME] with a name you can easily identify with the application.

sc create [SERVICE NAME] binPath= "c:\windows\srvany.exe"

Note this command is EXTREMELY picky, make sure there is a space after “binPath= “

Register the Command

Done!

Now you should have a fully functional service that you can use!

- By: Posted on:

Comments

Small ad here
Select a size at which to preview the size