Run Application as Windows 2008 Service
Windows 2008 do not provide toolkit similar like SrvAny and InstSrv that allow you to wrap the application and run as Windows Services.
- Download Windows 2003 Resource Kit from Microsoft http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
- Install the the Windows 2003 Resource Kit into any workstation or even Windows 2008 server. We only need the SrvAny.exe file from the resource kit
- Copy SrvAny.exe in C:\Windows\System32 of Windows 2008 Server
- Use "sc " to create a new service that launches "srvany " (e.g. sc create MyCustomService binPath= C:\Windows\System32\srvany.exe DisplayName= "My Custom Service" )
- Using RegEdit : create a "Parameters " key for your service (e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyCustomService\Paramaters\ )
- Using RegEdit : within the newly created "Parameters " key , 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.)
Below is the steps to make Inadyn (Simple Dynamic DNS client) to run as service
1. Download inadyn http://www.inatech.eu/inadyn/ (for OpenDNS, please download from http://www.opendns.com/support/ddns_files/inadyn-win32.zip)
2. Extract inadyn into c:\inadyn and do the necessary configuration by editing inadyn.conf
3. Copy SrvAny.exe from fron Windows 2003 Resource Kit into C:\Windows\System32
4. Create the service by the following command in command prompt
|sc create inadyn binPath= c:\Windows\System32\srvany.exe DisplayName= inadync start= delayed-auto|
5. Adjust the registy key. Below is the sample registry file. Just save the following content into anyfile.reg and then double-click to file to import it into registry.
; Edit the next line to show the full path to the inadyn.exe executable file. Note that any backslashes "\" in the path must be _doubled_ "\\"
; Edit the next line to replace "username" and "password" with your OpenDNS user name and password. The "--alias" string is arbitrary, and is really only relevant to more complex setups
6. Completed. You should be able to see th inadyn in the Windows Services.