I have a batch file, I want to run it as a windows service without using any additional software.
Asked
Active
Viewed 1.2k times
1
-
3Possible duplicate of [Create Windows service from executable](http://stackoverflow.com/questions/3582108/create-windows-service-from-executable) – LordNeo Feb 22 '17 at 11:36
-
Are you sure you need to create a Windows Service? Most of the times creating a Scheduled Task does the job as well. Anyway what you ask is not possible since you will have to create an executable, so there will alsways be *additional software* involved. – Filburt Feb 22 '17 at 11:40
-
Welcome to SO @Leo - Please read [here](http://stackoverflow.com/help/how-to-ask) regarding writing a good SO question. – garfbradaz Feb 22 '17 at 11:44
-
I used sc.exe to create one but it threw an error saying that the service did not respond to the start or control request in a timely fashion – Leo Feb 22 '17 at 12:00
1 Answers
2
You cannot use any random application as a service, it has to be written explicitly for this purpose.
In your case it is better to just create a scheduled task but if you insist on creating a service you can download the 2003 Resource Kit and use srvany.exe. If you don't mind using 3rd-party tools you could try NSSM instead.

Anders
- 97,548
- 12
- 110
- 164
-
here's how to make a sheduled task https://stackoverflow.com/questions/6568736/how-do-i-set-a-windows-scheduled-task-to-run-in-the-background – JonnyRaa Oct 09 '17 at 10:59