Discussion Locked

Start of Services from Command Line

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am using net start "Service_Name " , command to use to start the services. Issue is some time I get the error "Could not stop the Service". And when I check in Service Manager, status of that particular service become "stopping" and unless I kill the service from Task manager , it remains the same.

Same behavior is not observed when I start and stop services using standard service manager.

Is there any way to overcome this error??

Please let me know if any further information is needed

Thanks,

-Pramod

1 reply

by timthetoolman

Hi,

It possible its simply a timing issue. Stopping them from a script would be almost instantaneous for each service, but its possible that one service requires another to be running, only your script stops it before the first one can properly complete its stop.

Try putting pauses between each stop command to slow it down a little.

There is no native command in windows to pause a batch file for a specified time, but you can find a freebie at...

http://www.gammadyne.com/cmdline.htm#sleep

(remove spaces from the above URL)

Cheers,
Tim.

This discussion is closed to new replies.