Click here to Skip to main content
15,916,019 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello Coders,
I have written a program in c++. It retrieves the processes running in windows. I am creating a data base of these processes. For this I need to run that process in background, so I created its service using

Sc create......start= auto.

But It is giving an error every time
Windows can not start the "service name" service on Local Computer.
error 1053: The service did not respond to the start or control request in a timely fashion.

Thank You in anticipation

What I have tried:

I haven't used any kind of service creating coding in my code. I created service through cmd.
Posted
Updated 11-Apr-16 4:11am

You must create a service application that provides the necessary functions (main entry point, service entry point, and service control handler).

Some useful links:
Simple Windows Service in C++[^]
A basic Windows service in C++ (CppWindowsService) sample in C++ for Visual Studio 2008[^]
Service Programs (Windows)[^]
 
Share this answer
 
Comments
Suryakant Turing 11-Apr-16 13:18pm    
Jochen is there any other way except this- main entry point, service entry point, and service control handler if possible.
Jochen Arndt 11-Apr-16 15:46pm    
If you need a service, you have to create it. Just create it using the examples from my links moving the relevant code parts to the service worker thread.

If you don't want to create a service you can start normal applications using auto start. But those are only started upon login for users that have a corresponding auto start entry.
Sergey Alexandrovich Kryukov 11-Apr-16 17:37pm    
Sure, a 5.
—SA
Sergey Alexandrovich Kryukov 11-Apr-16 17:38pm    
You need to ask your question fairly. If you want another way, you should explain why, explain how this other way is different, what's wrong with the way which was shown to you and why. Otherwise it looks like "go there who knows where and bring me that who knows what".
—SA
Are you looking for something like SRVANY.EXE[^]?
 
Share this answer
 
Comments
Suryakant Turing 11-Apr-16 13:14pm    
I do not know what is it. I want to create service of my .exe file without ->main entry point, service entry point, and service control handler. If possible.
jeron1 11-Apr-16 13:22pm    
Maybe the instructions outlined here 'http://davidjnice.com/windows_server_run_as_service.html' might help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900