>Creating a User Defined Service in Windows 7


  One of the annoying things in ALL windows systems has been the lack of native support to create user defined services. Yes, you can type in the cmd prompt “sc create /?” to get some instructions to get some services that rely on executable files in Windows – but nothing really exists for web services and hosting in this regard. Way back in 2003 Microsoft released some developer tools for Windows Server 2003 and they have been used ever since – including (yes, it is true!) in Windows 7.

To setup a user defined service in Windows 7 for hosting purposes (in our case for our development server) – hopefully the following steps help you (its been written for the Trac project)

  1. Download instsrv.exe andsrvany.exe from Microsoft 2003 Resource Kit
  2. Open a windows cmd prompt (run as administrator) and punch in the service you want (in our case tracd) i.e. drive:\path\to\InstSrv.exe tracd drive:\path\to\SrvAny.exe
  3. Goto your Start Menu, type in “regedit” and goto the new service (in our case tracd) HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tracd
  4. Create subkey *Parameters* below which you must create 2 string values:
  5. Create an String Value called App– then right click on this and add drive:\path\to\Python25\Scripts\tracd.exe
  6. Create an String Value called AppParameters with the relevant parameters of the tracd.exe – i.e. drive:\Python25\Scripts\tracd –port 8080 –auth=proj_name,drive:\path\to\proj\digest.txt,trac drive:\path\to\proj\ if you were using Trac and wanted to generate passwords without apache
  7. Run net start tracd
  8. Complete!

Obviously, you can change this around and run it for any service you want to run it for and it will start up and appear in services.msc where you can start around the rest of the settings as you please.