Running an EXE as a service in windows server 2008

Here's what to do ...
 
  1. At the time of this posting, there is no Windows Server 2008 Resource Kit Tools, so get the "srvany.exe " from the "Windows Server 2003 Resource Kit Tools " http://www.microsoft.com/en-au/download/confirmation.aspx?id=17657   and copy it to a suitable location on your Win2008 server (e.g. C:\Windows\System32\ ).
  2. Use "sc " to create a new service that launches "srvany " (e.g. sc create MyService binPath= C:\Windows\System32\srvany.exe DisplayName= "My Custom Service")
  3. Using RegEdit : create a "Parameters " key for your service (e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\Paramaters\ )
  4. Using RegEdit : within the newly created "Parameters " key , create a string valuecalled "Application " and enter the full path to the application you are wanting to run as a service.  (No quotes required.)

And that should do it.

Note : some applications store their settings in a user hive, not under HKEY_LOCAL_MACHINE, so you will need to run the application to configure it, and then configure the service to run as that user.

Enjoy!
  • Proposed as answer by Graeme.N Wednesday, September 23, 2009 3:05 AM
  • 0 Kasutajad peavad seda kasulikuks
Kas see vastus oli kasulik?

Related Articles

INSTALL SERVER 2012 ON HP GEN 8 MACHINE

ProLiant Gen8 servers Use HP Intelligent Provisioning 1.40 (or later) to install...

SERVER 2012 INSTALLATION OPTIONS

Windows Server Installation Options 219 out of 255 rated this helpful - Rate this...