开发者

Starting a user defined service in windows Xp

开发者 https://www.devze.com 2023-04-12 04:25 出处:网络
I am creating a user defined service on Windows Xp using sc.exe To create I started with sc.exe create \"My Service\" binPath= \"D:\\Service.bat\"

I am creating a user defined service on Windows Xp using sc.exe To create I started with

sc.exe create "My Service" binPath= "D:\Service.bat"

Got a messa开发者_Go百科ge CreateService SUCCESS.

Then I entered services.msc in the RUN and found the service which I created was there

Right clicked My Service then properties and when I started

I get an error as

ERROR 1053: The service did not respond to the start in a timely fashion

How do I fix this error.

Thanks


I think you need to enter cmd as command;

sc.exe create "My Service" binPath= "cmd /c D:\Service.bat"

And make sure the batch file does not stop too quick. At the first line of the batchfile let it write to a logfile, so you can see it is being executed. (and use a location where the service user may write to).

echo starting at %date% %time% > d:\service.log

As an alternative you can also use srvany.exe, see KB137890, but that is more hassle.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号