Link to home
Start Free TrialLog in
Avatar of masvmasv
masvmasv

asked on

Application for Start and Stop NT services...

Hi !

I need a C/C++ source code for make a application for start and stop services... example:

MyApp ServiceName Start
MyApp ServiceName Stop

Thanks

Avatar of masvmasv
masvmasv

ASKER

For a better history...
I cant use "NET START" and
"NET STOP" commands.. ok ?
Why can't you use NET START and NET STOP?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Microsoft has TN in MSDN

Creating a Simple Win32 Service in C++

by Nigel Thompson


Hope it helps
>>Creating a Simple Win32 Service in C++

Unfortunately, this document is no longer available via MSDN...
Hmm... I am running January 2001 library and it is there...
Well, I meant the online version :o)
Hi !

This sample works fine for stop services...
But for Start service is not only change the STOP to START... but I found another example...

But this your example was good for help me...

Thanks
Sorry, you are right - you'd have to use 'StartService()' instead of 'ControlService()' in the above sample in order to adapt it to start a service...