본문 바로가기

Computer/MSWin

NT Service Controller: sc, netsvc


Sc.exe: This tool provides a way to communicate with Service Controller (Services.exe) from the command prompt, to retrieve information about services.
Netsvc.exe: This tool provides a way to remotely start, stop, and query the status of services from the command line.



C:\>sc \\REMOTE1 config Schedule start= disabled
[SC] ChangeServiceConfig SUCCESS

C:\>netsvc /start \\REMOTE1 "Schedule"
Error code 1058

C:\net helpmsg 1058

The specified service is disabled and cannot be started.
C:\>sc \\REMOTE1 config Schedule start= demand [SC] ChangeServiceConfig SUCCESS

C:\>netsvc /start \\REMOTE1 "Schedule"
Service is pending start on \\REMOTE1

C:\>sc \\REMOTE1 qc Schedule
[SC] GetServiceConfig SUCCESS

참조: http://support.microsoft.com/kb/166819

http://www.ss64.com/nt/sc.html
http://www.ss64.com/ntsyntax/services.html