Archive for February 2011

Win32 EXE to service in Windows Server 2008

We had a server meltdown happen here earlier this week, and as part of the collateral damage, an automated order processing application that has been running since 2004 has been off-line. This application was written in VB6 with a minimal user interface, and as such, I have always remoted into the server, started the program up on the server and left it open, and then just closed my remote desktop application, which left the session open and running.

We wanted to change this to make it a bit more reliable, which means Windows service. Unfortunately, the application does not have the correct hooks in it that make it be able to be seen as a service. (I could create a service with the EXE name as the target, and the EXE would run when I started up the service, but it would soon crash as service manager could not find something it was looking for.)

After a little bit of digging, I found some suggestions on using the srvany.exe application as a shell to launch my application, and I must say it seems to work marvelously. Here is the link where I found the solution:

Application as a Service “srvany.exe” in Windows Server 2008

Here are the important steps from the article above (in case it relocates or disappears):

  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 ” 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\Parameters\ )
  4. 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.)

In the article linked above, keep in mind that Parameters is misspelled at the end of item #3, I have corrected it in my item #3 above. Other than that, it seems to be working great.

Spell checkers should still work in other countries, shouldn’t they?

The rechargeable battery for my Dell Axim X51V was looking a bit puffy, so I ordered a replacement battery pack off of Amazon.

Batteyr Pack

Batteyr Pack

BTW, happy birthday to Niecy Nash. Tempestt is doing ok, but we miss the special energy and chemistry you had with your co-hosts.

Cool baseball app

It’s about time that somebody did something awesome with the retrosheet data…

Pennant for iPad (link removed, app is no longer available)

I wish I had an iPad.

BTW, happy birthday to Joel Hodgson, one of the true geniuses of our time.

OK, you may have had a tough coach at some point growing up, but you have to let it go…

A co-worker found this nice little nugget in one of our sports web site applications:

Dim isAssHeadCoach As Boolean = Session("IsAssHeadCoach")

I hope it is meant to check for an assistant or associate head coach.

Code 39

Did you ever get the dreaded “Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)” message in your Device Manager for your DVD/CD-ROM drive?

This happened to a computer here at our office, and it did this for both the internal drive and for an external USB drive that we hooked up to it as well.

Well, to solve the problem, we found this link and ran a neat little automated program from Microsoft that went in and fixed up the drivers for both the internal and external drives.

Your CD or DVD drive can’t read or write media

Very cool. This was way easier than some of the other solutions that we were seeing.