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?
Jack 50Asked:
Who is Participating?
 
Sam Simon NasserIT Support ProfessionalCommented:
Use task schedule and set to run these services as administrator
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Nothing. If the service is not started, you cannot stop it!
You can redirect error output to suppress it by appending >2 nul
0
 
Jack 50Author Commented:
thanks
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
The acce0ted comment is not an answer to your question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.