Command format
SC command format: SC [Servername] command Servicename [optionname= optionvalues
* The service name is the name of the service itself, not the display name,
Add a space after the *= number before you can write the option name
The SC command has a total of 24 subcommand commands, as shown below
SC Boot SC config SC continue SC control SC create SC delete sc descrīption
SC enumdepend SC failure SC getdisplayname SC getkeyname SC interrogate
SC lock SC pause SC QC SC qdescrīption SC qfailure sc query sc queryex
SC querylock SC sdset SC sdshow SC start sc stop
More commonly used, prohibit or open service
sc config tlntsvr start= auto ' set Telnet service to Automatic
sc config tlntsvr start= disabled ' set Telnet service to prohibit
Start or stop and suspend service
sc start tlntsvr ' start Telnet service
sc stop tlntsvr ' stop Telnet service
Sc pause tlntsvr ' pause telnet Service
Delete Service
Sc Delete tlntsvr ' remove Telnet service, but it is best not to remove the system with its own services ...
Create a service
SC Create test binpath= c:\windows\notepad.exe start= Auto ' Create Notepad.exe for test service, starting with automatic
SC Help
------------------------------
DESCRIPTION:
SC is a command line program used for communicating with the
NT Service Controller and services.
USAGE:
SC <server> [command] [service name] <option1> <option2>
The option <server> has the form ""
Further help on commands can is obtained by typing: "SC [command]"
Commands:
Query-----------Queries The status for a service, or
Enumerates the status for types of services.
Queryex---------Queries The extended status for a service, or
Enumerates the status for types of services.
Start-----------starts a service.
Pause-----------sends a pause control request to a service.
Interrogate-----sends a interrogate control request to a service.
Continue--------sends a continue control request to a service.
Stop------------sends a STOP request to a service.
Config----------Changes the configuration of a service (persistant).
Description-----Changes The description of a service.
Failure---------Changes The actions taken by a service upon failure.
Sidtype---------Changes The service SID type a service.
QC--------------Queries The configuration information for a service.
Qdescription----Queries The description for a service.
Qfailure--------Queries The actions taken by a service upon failure.
Qsidtype--------Queries The service SID type a service.
Delete----------Deletes a service (from the registry).
Create----------creates a service. (adds it to the registry).
Control---------sends a service.
Sdshow----------Displays a service ' s security descriptor.
Sdset-----------Sets A service ' s security descriptor.
Showsid---------Displays the service SID string corresponding to a AR
Bitrary name.
Getdisplayname--gets the DisplayName for a service.
Getkeyname------Gets The Servicekeyname for a service.
EnumDepend------enumerates Service dependencies.
The following commands don ' t require a service name:
SC <server> <command> <option>
Boot------------(OK | bad) indicates whether the last boot should
Be saved as the Last-known-good boot configuration
Lock------------Locks the Service Database
Querylock-------Queries The lockstatus for the Scmanager Database
EXAMPLE:
SC start MyService
Would for the QUERY and QUERYEX commands? [y | n]: