I found two other options that won't have you reaching for your wallet.
You can have sc
launch srvany
which then points to your program. (there's a forum post that I can't link to because I don't have enough rep here though I do on StackOverflow - grumble)
Here are the steps that the original poster used:
- 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"
)
- Using RegEdit: create a
Parameters
key for your service (e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\Parameters\
)
- 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.)
If that seems like a bit of a hack, then you can build a .NET service to launch your process. If you want to skip a few steps, here's an open source .NET service that can launch generic processes:
http://www.codeproject.com/KB/system/xyntservice.aspx
Tweak it to your needs but it'll do most of what you want out of the box.