Running an application as a service

Shadowspawn

[H]ard|Gawd
Joined
Sep 17, 2002
Messages
1,870
I have a small executable that I need to run as a service in a fully updated Server 2003. If memory serves, NT had tools built in to do this, but my Google searches only turn up third party applications, nothing native to 2003. Anybody have experience doing this?
 
You will need to use the SRVAny.exe in the 2003 resource kit. I don't remember the switches or how to do it off the top of my head and I can't seem to find my notes on it at the moment.

Hope this helps
 
srvany.exe/instsrv.exe are supposed to do this. however, the two times i've needed to create a service, they didn't work.

here is my work-around if you do not/can not buy 3rd party software: put a shortcut to the .exe in the startup folder. download power toys tweak UI and set the server to auto-login; this is incase the server reboots. now, set the screen saver to start after one minute and to password protect.

ghetto? yep! but it works and the server is only un-protected for one minute.
 
t00thless said:
srvany.exe/instsrv.exe are supposed to do this. however, the two times i've needed to create a service, they didn't work.

I too have had problems with them in the past. I think that it depends on the way that the .exe was coded. The only problem with putting the program in the startup is if the program fails you may not know that the program failed and it would have no way of restarting the app. I guess this is just a catch 22. If anyone has a better solution I would like to hear it. :)
 
oooohhhh Rights escalation....

Remember the good ol' days when you could replace one of the services with cmd.exe and get admin rights? Ah the good times we once had. :D
 
t00thless said:
srvany.exe/instsrv.exe are supposed to do this. however, the two times i've needed to create a service, they didn't work.

here is my work-around if you do not/can not buy 3rd party software: put a shortcut to the .exe in the startup folder. download power toys tweak UI and set the server to auto-login; this is incase the server reboots. now, set the screen saver to start after one minute and to password protect.

ghetto? yep! but it works and the server is only un-protected for one minute.

one minute is all someone really needs could just set it up as a scheduled task
 
I apologize for taking so long to reply. This program needs to be running at all times, no matter who logs into the server. Thats why I cannot use the startup folder. Our site has been having power problems which has caused the servers to reboot and nobody notices until our customers complain several hours later. So if I can run the application as a service then it will be up and running immediately after the reboot, whether or not anyone logs on.

I will give the srvany.exe/instsrv.exe files a try. I think those are the files I remember from NT days. If this fails, then toothless's suggestion may be the way to go - although it will only work for the primary admin account and I would like the application to be running no matter what account logs in.

I will let you know what happens, in case anyone else needs help.
 
Just to help anybody else that needs to create a service out of an application that isn't coded to run as a service:

The resource kit for NT/2000/2003 includes srvany.exe and instsrv.exe. These files let you create a service that runs srvany.exe as a service. Srvany.exe then can load any executable automatically. This works great and resolved my issue.

Thanks for the advice guys.

BTW, SC.exe doesn't run non-service coded applications.
 
Back
Top