Home

Archive for September, 2009

Creating a User Defined Service in Windows 7

Tim DavisOne 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:\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 tracdHKEY_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.

No comments

Windows 7 “Default Gateway 0.0.0.0″ Problem

Tim DavisSo I am all excited to install the new Windows 7 Ultimate x64 operating environment. The installation was a breeze – but the internet setup not so. I would have thought that the internet setup would have been a piece of cake – but unfortunately I was sorely mistaken. Now I am a huge Microsoft Fan (although I also use an iMac) and was a bit perturbed when this happened – hoping that Mum & Dad Windows 7 users wouldn’t face the same issues.  The solution was relatively easy to fix but did require a little bit of playing around as the cmd –> Run as Administrator console was denying all relevant “ipconfig /renew” or “ipconfig /release” commands.

In the end – I discovered the solution as:

  1. If you have already setup your internet and you are now getting this error – you MUST click Start –> Type “cmd” –> Right Click –> Run as Administrator
  2. A black window will appear (for those who have never done this) – you must type in “netsh int ip reset c:\resetlog.txt” and “netsh winsock reset c:\winsock.txt
  3. You must now reset your computer.
  4. On reboot – right click on the “Network Connections” and open the “Network & Sharing Center”
  5. Click on whatever connection you have – a new window will appear with “Details, Properties, Disable, Diagnose” buttons
  6. Click on “Properties” and then uncheck the Internet Protocol Version 6 (TCIP/IPv6)” checkbox.
  7. Click OK and then Close.

Now you can either Reopen this console if you need to enter a Static IP Address or you can ask Windows to find your Network via the “Network & Sharing Center”. Everything will now work (or should anyway!)

7 comments