views:

215

answers:

3

I have an .exe I want to start when the Win2k3 server boots. Does .exe needs to be setup as a custom service. If so, what is the process to setup the custom service?

A: 

If you want to create that service manually, you can use sc.exe for the job. However that exe must be capable to run as service of course.

driAn
+1  A: 

I assume you don't really mean at boot time (you would have to write a driver service for that) but rather at user mode system start up.

If your process is uncomplicated you could just set it up as a scheduled task - with the trigger set to system start. If it needs to interact with the system more, i.e. needs to be paused, needs to be shutdown, warned of system events such as power events or shutdown, etc. then you should probably look to convert it to a Win32 service.

If you do need to convert to a service then start reading here and then continue with something like Richter's or Miller's books until you really understand what you are doing. Then write your service application.

Stephen Martin
What is "user mode system start up"? My end goal is to have the .exe running on the server without any users having to log in to the system once it is booted. If the .exe can be scheduled to start under a user in the background without requiring interactive login I'd be set.
Jared Brown
By "user mode start up" I mean when the user mode services are being started up. Prior to that only file system drivers, device drivers, native executables, etc. are being run. If you want to start up without a user logged in and run until the computer shuts down then this is what you want.
Stephen Martin
If that is all you need - start process, run until shutdown then you can easily set up a task in the Task Scheduler with the trigger set to "When the computer starts". This task can be run under the SYSTEM account or any user account you want.
Stephen Martin
A: 

XYNTservice a simple service that can start pretty much any program as a service.

http://www.codeproject.com/KB/system/xyntservice.aspx

Kalmi
btw the windows version of freeradius.net uses it
Kalmi