NT Service ?

How do i write a program that runs as a Windows NT service ?

Basically i want to achieve this :
I want to invoke a carry out a certain activity (liking invoking a certain application) based on time. That is, i schedule some activities for some time in future. Now, my appln. should continuosly check for time and if it is time to carry out that activity, simply do that, and continue running.

I guess, i must write a program that runs in background as a NT service.

How do i do this ?
Any code or info. on where i can find help on this would be helpful.

Thx.
LVL 1
JituAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TimCotteeHead of Software ServicesCommented:
An NT service is simply an executable that has been configured as a service.

However if you are particularly interested in carrying out specfic activities based on time then you are much better off when running under NT using the scheduler service which is already available as standard. This allows you to use the AT command to schedule activity at a specific time.

If you have the NT resource kit, there is also a utility called WINAT which provides a graphical interface to the scheduler rather than a CMD prompt interface. The resource kit also includes some information on installing executables as NT services and some considerations regarding such applications in that an NT service cannot have both a user interface AND network access at the same time unless certain additional configuration changes are made to the network.

0
MTroutwineCommented:
Microsoft already has an ActiveX control that can be used to create an NT Service.  Here is the URL for the files (it includes a sample application) and the VB code to implement it!

http://msdn.microsoft.com/library/techart/msdn_ntsrvocx.htm

:>)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mdouganCommented:
Bought this question.

I'd already downloaded the sample listed in the answer.  It's just the C source code, and you have to recompile it.  I did this, but ran into several errors because the example was written in 1996, and the version of Visual C compiler they used was outdated.  After some trials, I got it to compile, but never got it to load into VB 6......
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.