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.

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 and srvany.exe from Microsoft 2003 Resource Kit (I’ve included them in this post but feel free to download them from Microsoft if you want)
  2. Open a windows cmd prompt (run as administrator) and punch in the service you want (in our case tracd) i.e. drive:pathtoInstSrv.exe tracd drive:pathtoSrvAny.exe
  3. Goto your Start Menu, type in “regedit” and goto the new service (in our case tracd) HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicestracd
  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:pathtoPython25Scriptstracd.exe
  6. Create an String Value called AppParameters with the relevant parameters of the tracd.exe — i.e. drive:Python25Scriptstracd — port 8080 — auth=proj_name,drive:pathtoprojdigest.txt,trac drive:pathtoproj 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.