Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to stop and perform an action from a management server, on a remote server, using cygwin and the "sc" command.

The syntax s/b: "sc \\remote {query\stop\start} sshd
This yielded:

 $ sc \\server stop sshd
 ERROR:  Unrecognized command

I tried cygstart sc \\server stop sshd This yielded:

$ cygstart -v sc \\server stop sshd
ShellExecute(NULL, "(null)", "sc", "\server stop sshd", "(null)", 1)

I also tried cygstart sc \\\\server stop sshd

This yielded:
$ cygstart -v sc \\\\server stop sshd
ShellExecute(NULL, "(null)", "sc", "\\server stop sshd", "(null)", 1)

Since the service I'm may be starting is sshd, I can't use ssh \server -C sc start sshd.

Any suggestions would be gratefully accepted.

share|improve this question
I think you should use 'cygrunsrv' to manage services from Cygwin – golimar Jan 28 at 12:12

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.