0

Make any application run as a service

What I wantedservice

I have personally come accross quite a few senarios where I require an application to be run as a service on a server. One of the these senarios was to implement a web print solution. The idea was to have Google Chrome Browser run on a server whilst no one was logged in to the server therefore requiring it to be run as a service, Google Chrome would be signed into a Google account which had a printer attached and the printer shared out to all other users. Then from a mobile device you would be able to print utilising the Google Cloud Print solution.

Whats Required

A server (running 2003 or 2008)

Google Chrome installed – signed in to a google acocount with printer attached

Windows Server 2003 Resource Kit Tools – Need to download for Server 2008

Solution

The solution was to use srvany.exe from within the Windows Server 2003 Resource Kit. This was fairly simple and can be used to run any application as a service.

  1. If you are using Server 2008 you will need to download the “Windows Server 2003 Resource Kit Tools ” and copy the srvany.exe to a suitable location on your Windows 2008 server (e.g. C:\Windows\System32\ ).
  2. Use “sc ” to create a new service that launches “srvany
    sc create MyService binPath= C:\Windows\System32\srvany.exe DisplayName= “My Custom Service” )
  3. Using RegEdit : create a “Parameterskey for your service (e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\Paramaters\ )
  4. Using RegEdit : within the newly created “Parameterskey , create a string value called “Application ” and enter the full path to the application you are wanting to run as a service. (No quotes required.)

That’s it.

CygnusH33L

Leave a Reply

Your email address will not be published. Required fields are marked *