well, Thank you very much for your help. I understood the logic. But where should i do that? let me put the question in other way. see the following is my code for starting the service (i took it from msdn) DWORD StartSampleService(SC_HANDLE schSCManager) { SERVICE_STATUS ssStatus; DWORD dwOldCheckPoint; DWORD dwStartTickCount; DWORD dwWaitTime; DWORD dwStatus; SC_HANDLE schService; CString cstrMessage,cstrCaption; cstrCaption="Service Message"; char ServiceName[50]; LPCTSTR lpszServiceName; cout<<"Enter the Name of the service: "; cin>>ServiceName; lpszServiceName=(LPCTSTR)ServiceName; schService = OpenService( schSCManager, // SCM database lpszServiceName, // service name Here I gave my sample service, Please change this SERVICE_ALL_ACCESS); //according to your wish.. see that the service is in not running currently. if (schService == NULL) { cstrMessage="OpenService"; // MessageBox(NULL,cstrMessage,cstrCaption,NULL); cout<<"Error code "< 10000 ) dwWaitTime = 10000; Sleep( d