I am attempting to start/stop services via a script. The command is
sc stop "service name"
It is failing with this error
{SC} OpenService FAILED 123:

Any assistance would be appreciated.

Recommended Answers

All 4 Replies

have you tried:

sc \\servername stop "service name"

And be sure to use the Service Name, not the display name. check via ..
sc query

And be sure to use the Service Name, not the display name. check via ..
sc query

That was it. I used this script several months ago and it worked using the display name. Using the service name as displayed with the query commmand worked. thanks a million.

Occasionally it would, because sometimes Service Name is the same as the Display Name, as you would have noticed.
Cheers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.