Link to home
Start Free TrialLog in
Avatar of Jack 50
Jack 50

asked on

Windows Services start / stop

Trying to create a couple of batch files to start / stop services on a remote server (still on internal network)

Dont want to use PowerShell... just create a normal batch file.


Server its running the batch file from is 2016, and the remote server is 2008r2

Tried to do

sc \\machine stop "service"

but get an error

[SC] ControlService FAILED 1062

The service has not been started.


what have i done wrong?
Avatar of Qlemo
Qlemo
Flag of Germany image

Nothing. If the service is not started, you cannot stop it!
You can redirect error output to suppress it by appending >2 nul
ASKER CERTIFIED SOLUTION
Avatar of Sam Simon Nasser
Sam Simon Nasser
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jack 50
Jack 50

ASKER

thanks
The acce0ted comment is not an answer to your question.