天天看点

windows service controller command: ScSc

08/31/2016

2 minutes to read

Applies To: Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2003 with SP2, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2012, Windows Server 2003 with SP1, Windows 8

Communicates with the Service Controller and installed services. The SC.exe program provides capabilities similar to those provided in Services in the Control Panel.

For the syntax of any of the commands in the following table, click the command name.

Sc command

Description

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742074%28v%3Dws.11%29">Sc boot</a>

Indicates whether the last boot should be saved as the last-known good boot configuration.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc990290%28v%3Dws.11%29">Sc config</a>

Modifies the value of a service's entries in the registry and in the Service Control Manager database.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742080%28v%3Dws.11%29">Sc continue</a>

Sends a CONTINUE control request to a paused service.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742013%28v%3Dws.11%29">Sc control</a>

Sends a control to a service.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc990289%28v%3Dws.11%29">Sc create</a>

Creates a subkey and entries for the service in the registry and in the Service Control Manager database.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742045%28v%3Dws.11%29">Sc delete</a>

Deletes a service subkey from the registry.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742069%28v%3Dws.11%29">Sc description</a>

Sets the description string for a service.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742075%28v%3Dws.11%29">Sc enumdepend</a>

Lists the services that cannot run unless the specified service is running.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742019%28v%3Dws.11%29">Sc failure</a>

Specifies one or more actions to be taken if a particular service fails.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742011%28v%3Dws.11%29">Sc failureflag</a>

Specifies whether to trigger recovery actions when a service stops as the result of an error.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742092%28v%3Dws.11%29">Sc getdisplayname</a>

Gets the display name associated with a particular service.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742082%28v%3Dws.11%29">Sc getkeyname</a>

Gets the key name associated with a particular service, using the display name as input.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742167%28v%3Dws.11%29">Sc interrogate</a>

Sends an INTERROGATE control request to a service.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742176%28v%3Dws.11%29">Sc lock</a>

Locks the Service Control Manager's database.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742122%28v%3Dws.11%29">Sc pause</a>

Sends a PAUSE control request to a service.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742055%28v%3Dws.11%29">Sc qc</a>

Queries the configuration information for a service.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742030%28v%3Dws.11%29">Sc qdescription</a>

Displays a service's description string.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742047%28v%3Dws.11%29">Sc qfailure</a>

Displays the actions that will be performed if the specified service fails.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dd228922%28v%3Dws.11%29">Sc query</a>

Obtains and displays information about the specified service, driver, type of service, or type of driver.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dd228921%28v%3Dws.11%29">Sc queryex</a>

Obtains and displays detailed information about the specified service, driver, type of service, or type of driver.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742073%28v%3Dws.11%29">Sc querylock</a>

Queries and displays the lock status for the Service Control Manager database.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742037%28v%3Dws.11%29">Sc sdset</a>

Sets a service's security descriptor, using Security Descriptor Definition Language (SDDL).

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742133%28v%3Dws.11%29">Sc sdshow</a>

Displays a service's security descriptor, using SDDL.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742126%28v%3Dws.11%29">Sc start</a>

Starts a service.

<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc742107%28v%3Dws.11%29">Sc stop</a>

Sends a STOP control request to a service.

SC.exe retrieves and sets control information about services.

You can use SC.exe for testing and debugging service programs.

Service properties stored in the registry can be set to control how service applications are started at boot time and can be run as background processes.

You can use the SC.exe parameters to configure a specific service, retrieve the current status of a service, and stop and start a service.

You can create batch files that call various SC.exe commands to automate the startup or shutdown sequence of services.

本文转自 h2appy  51CTO博客,原文链接:http://blog.51cto.com/h2appy/2062197,如需转载请自行联系原作者

继续阅读