How can I start and stop services on a remote machine?

I have a requirement in the project, so we have to stop a specific service, say, “x” on a remote machine (which is on the same local network), remotely delete the registry key and start the service again.

I tried the command sc \server stop servicebut got an error:

[SC] GetServiceKeyName FAILED 1060:

The specified service does not exist as the installed service.

I am using Windows 2003 SP1. Are there any built-in commands or APIs available on Windows?

I need commmand to run on the command line.

+3
source share
4 answers

, " ", "sc", , ( ).

, , , " Adobe Acrobat" , "AdobeARMservice". , , "sc".

:

sc Stop "AdobeARMservice" (works)
sc Stop "Adobe Acrobat Update Service" (doesn't work)

"" , " " "".

, .

+7

PSTools SysInternals. Windows.

, PsTools, , :

PsExec - execute processes remotely
PsFile - shows files opened remotely
PsGetSid - display the SID of a computer or a user
PsInfo - list information about a system
PsKill - kill processes by name or process ID
PsList - list detailed information about processes
PsLoggedOn - see who logged on locally and via resource sharing 
PsLogList - dump event log records
PsPasswd - changes account passwords
PsService - view and control services
PsShutdown - shuts down and optionally reboots a computer
PsSuspend - suspends processes
PsUptime - shows you how long a system has been running since its last reboot
+4

From this URL :

To stop a service remotely you can use the command sc.

Example:
> sc \\computer stop "Service Name"
> sc \\computer start "Service Name"

Perhaps you are missing the "\" character?

+2
source

Use OpenCSManager, then OpenService, then StartService.

0
source

Source: https://habr.com/ru/post/1703329/


All Articles