Answered by:
Using SC.exe with PSEXEC returns 1060 error

Question
-
Hi there,
I have cleared the temp folder on the server where my windows service is running and when i try and use sc.exe \\SERVERNAME STOP SERVICENAME i get the 1060 error.
By the way i am using command line to stop the service. I am also using the PSEXEC tool to stop the service on the remote server.
Here is my code:psexec -accepteula \\THESERVER -e -s -u DOMAIN\testuser -p thepassword7 sc.exe \\THESERVER STOP ParisConnect;
The error i get is this:
PsExec v2.11 - Execute processes remotely Copyright (C) 2001-2014 Mark Russinovich Sysinternals - www.sysinternals.com [SC] OpenService FAILED 1060: The specified service does not exist as an installed service sc.exe exited on THESERVER with error code 1060.
I tried invoking a cmd.exe on the remote server to test connectivity and this worked. I was able to start the cmd.exe process.
Any ideas why this error could be happening? The account i am currently using is part of the Administrators group on the server.
Kind Regards,
Answers
-
you actually don't need to do both psexec and sc
sc already supports doing remote service commands, it's the net command that doesn't support remote access
- Marked as answer by Vivian_WangModerator Wednesday, June 4, 2014 2:51 AM
-
was the service running?
- ERROR_SERVICE_DOES_NOT_EXIST
- 1060 (0x424)
-
The specified service does not exist as an installed service.
maybe you should query first whether the service is running or not, if the service runs then stop it.
Every second counts..make use of it. Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
IT Stuff Quick Bytes- Marked as answer by Vivian_WangModerator Wednesday, June 4, 2014 2:51 AM
All replies
-
Hi,
According to your description, you didn't post in a correct forum. I help move this case to Windows Server General Forum for better response.
Thank you for your understanding!
Best regards,
-
Hi,
Make sure you have the correct service name. A service can have a service name, and a display name which is different from the former.
Did you use the services console to have a try?
Clicking on the left hand side and then selecting the "Connect to another computer" option in the Action menu.
Regards.
If you have any feedback on our support, please click here
Vivian Wang
-
-
you actually don't need to do both psexec and sc
sc already supports doing remote service commands, it's the net command that doesn't support remote access
- Marked as answer by Vivian_WangModerator Wednesday, June 4, 2014 2:51 AM
-
-
was the service running?
- ERROR_SERVICE_DOES_NOT_EXIST
- 1060 (0x424)
-
The specified service does not exist as an installed service.
maybe you should query first whether the service is running or not, if the service runs then stop it.
Every second counts..make use of it. Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
IT Stuff Quick Bytes- Marked as answer by Vivian_WangModerator Wednesday, June 4, 2014 2:51 AM