Click to See Complete Forum and Search --> : How to start/stop NT services?


vhgupta
March 30th, 2001, 02:43 AM
I wants to start & stop service using my app.
Expecting a detailed soln as i m a beginner

:-)

ecannizzo
March 30th, 2001, 09:41 AM
I'm not sure that you can do this in your app. I think you might have to create a batch file that does this for you...

Erica

coolbiz
March 30th, 2001, 10:27 AM
This will involve a lot of importing Win32 APIs into your code. I've never done it b4 but here are some functions (WIN32 APIs) that you can look into:

OpenSCManager() to get SCM handle
OpenService() to get the service handle
ControlService() to stop the service
CloseServiceHandle() to clsoe the service handle

Good Luck,
-Cool Bizs