views:

272

answers:

2

I have window XP 2003 server, which is placed in a room where no one can enter to logon it.

for monitoring some applications I created a console application myServer.exe, which dont have any UI, I want that this application (e.g., myServer.exe) start automatically as window bootup (e.g., before window logon)

and I need to do this work using windows service.

(note: please don't suggest me any other solution, I need to use windows service to accomplish this task)

+2  A: 

The WinNT resource kit includes a utility called SRVANY.EXE that can be used to run any application as a service. ocdecio's solution is better but if for some reason you can't redesign the app SRVANY.EXE may work. Here's the KB Article.

Dave Swersky
Your article is nice, if it really works then it will make my life easier, let me search Instsrv.exe and srvany.exe, then I will update you
Jhone
I hope this isn't in support of the keylogger question you just asked...
Dave Swersky
looks like someone is trying to play at school.
Matthew Whited
A: 

You can develop Windows services directly in C#. If you have Visual Studio Professional, there is a built-in project template for a Windows service.

MSDN has a walkthrough of creating a service with C# that explains the process clearly.

If you don't have Visual Studio Professional, you can still create a service. You'll just need to create a class that inherits from System.ServiceProcess.ServiceBase manually.

A quick Google search turned up a couple of other links that may be helpful to you:

Daniel Pryden