Hi,
Can someone tell me how I can stop or start the service on a remote server? In addition I also need to check that the service has definatly stopped.
Thanks
Neil
Hi,
Can someone tell me how I can stop or start the service on a remote server? In addition I also need to check that the service has definatly stopped.
Thanks
Neil
Thanks D.M.
That all works now
Neil
Well, it did work but I have stopped the service then I intend to run a routine of moving files around then I want to start the service again.
When I run the script the service stops fine but when I want to start the service nothing happens. I have cut out the start part of my script and it works fine on it's own but not when it's in the main script. does anyone else have this problem? is it a bug in winautomation?
Thanks
Neil
| Attachment | Size |
|---|---|
| Start Remote Service.waj | 29 KB |
Hm... I took a look at your job and I have one question:
What kind of changes did you make? Did you change the %WorkingDir% variable?
Please go to action no.58 and in the working folder input field, change %WorkingDir% with "%WorkingDir%" (enclose the variable in double quotes).
==Dedicated Automation Solutions==
I changed so many things to try to get this to work but it works a treat now.
Thanks again
To stop a service remotely you can use the command sc in the "Run DOS Command" action.
Example:
-> sc \\computer stop "Service Name"
-> sc \\computer start "Service Name"
You can then parse the output of the command through the "Parse Text" action and depending on the results, figure out whether the command was successful or not.
There is another way to do that, which is far more complicated and I wouldn't recommend using it (unless there is a very good reason, and I cannot think of one at the moment). This method uses VBScript and WMI to start and stop the service. If you would like to see a sample implementation, I have attached a job that I created for a customer a long time ago.
This job will get a list of the services in the remote machine and prompt you to select which service you want to start/stop.
However, as I foretold, I would suggest using the sc command if it suits your needs.
==Dedicated Automation Solutions==
==Dedicated Automation Solutions==