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.