I have a Python web application running in a CherryPy server, which is running as a windows service. I have a batch file to deploy this application, but I'm still having to remote desktop in to the server to restart the service. Is there any way to script this?
I tried:
psexec \\server "net restart cherrypyservice"
But this doesn't seem to work.
Best Answer
you could use the sc command-line tool but i don't know how to do it specifically in python.
https://stackoverflow.com/questions/133883/stop-and-start-a-service-via-batch-or-cmd-file/133926#133926
DESCRIPTION: SC is a command line program used for communicating with the NT Service Controller and services. USAGE: sc [command] [service name] ...
EXAMPLE: sc start MyService