windows service controller command: Sc

简介:

Sc

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 Commands

Sc command

Description

Sc boot

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

Sc config

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

Sc continue

Sends a CONTINUE control request to a paused service.

Sc control

Sends a control to a service.

Sc create

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

Sc delete

Deletes a service subkey from the registry.

Sc description

Sets the description string for a service.

Sc enumdepend

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

Sc failure

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

Sc failureflag

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

Sc getdisplayname

Gets the display name associated with a particular service.

Sc getkeyname

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

Sc interrogate

Sends an INTERROGATE control request to a service.

Sc lock

Locks the Service Control Manager's database.

Sc pause

Sends a PAUSE control request to a service.

Sc qc

Queries the configuration information for a service.

Sc qdescription

Displays a service's description string.

Sc qfailure

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

Sc query

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

Sc queryex

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

Sc querylock

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

Sc sdset

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

Sc sdshow

Displays a service's security descriptor, using SDDL.

Sc start

Starts a service.

Sc stop

Sends a STOP control request to a service.

Remarks

  • 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,如需转载请自行联系原作者
目录
相关文章
|
3月前
|
Linux C++ Windows
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
|
16天前
|
C# Windows
【Azure App Service】在App Service for Windows上验证能占用的内存最大值
根据以上测验,当使用App Service内存没有达到预期的值,且应用异常日志出现OutOfMemory时,就需要检查Platform的设置是否位64bit。
39 11
|
3月前
|
Java 应用服务中间件 开发工具
[App Service for Windows]通过 KUDU 查看 Tomcat 配置信息
[App Service for Windows]通过 KUDU 查看 Tomcat 配置信息
|
3月前
|
Java 应用服务中间件 Windows
【App Service for Windows】为 App Service 配置自定义 Tomcat 环境
【App Service for Windows】为 App Service 配置自定义 Tomcat 环境
|
3月前
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
|
3月前
|
PHP 开发工具 git
【Azure 应用服务】在 App Service for Windows 中自定义 PHP 版本的方法
【Azure 应用服务】在 App Service for Windows 中自定义 PHP 版本的方法
|
3月前
|
网络安全 API 数据安全/隐私保护
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Windows)
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Windows)
|
3月前
|
Shell PHP Windows
【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.
【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.
|
3月前
|
存储 Linux Windows
【应用服务 App Service】App Service For Windows 如何挂载Storage Account File Share 示例
【应用服务 App Service】App Service For Windows 如何挂载Storage Account File Share 示例
|
3月前
|
应用服务中间件 nginx Windows
【Azure 应用服务】在App Service for Windows中实现反向代理
【Azure 应用服务】在App Service for Windows中实现反向代理