Modifies the value of a service's entries in the registry and in the Service Control Manager database.
For examples of how to use this command, see Examples.
Syntax
sc [<ServerName>] config [<ServiceName>] [type= {own | share | kernel | filesys | rec | adapt | interact type= {own | share}}] [start= {boot | system | auto | demand | disabled | delayed-auto}] [error= {normal | severe | critical | ignore}] [binpath= <BinaryPathName>] [group= <LoadOrderGroup>] [tag= {yes | no}] [depend= <dependencies>] [obj= {<AccountName> | <ObjectName>}] [displayname= <DisplayName>] [password= <Password>]
Parameters
Parameter | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<ServerName> |
Specifies the name of the remote server on which the service is located. The name must use the Universal Naming Convention (UNC) format (for example, \\myserver). To run SC.exe locally, omit this parameter. |
||||||||||||||||
<ServiceName> |
Specifies the service name returned by the getkeyname operation. |
||||||||||||||||
type= {own | share | kernel | filesys | rec | adapt | interact type= {own | share}} |
Specifies the service type.
|
||||||||||||||||
start= {boot | system | auto | demand | disabled | delayed-auto} |
Specifies the start type for the service.
|
||||||||||||||||
error= {normal | severe | critical | ignore} |
Specifies the severity of the error if the service fails to start at boot time.
|
||||||||||||||||
binpath= <BinaryPathName> |
Specifies a path to the service binary file. |
||||||||||||||||
group= <LoadOrderGroup> |
Specifies the name of the group of which this service is a member. The list of groups is stored in the registry, in the HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. The default value is null. |
||||||||||||||||
tag= {yes | no} |
Specifies whether or not to obtain a TagID from the CreateService call. Tags are used only for boot-start and system-start drivers. |
||||||||||||||||
depend= <dependencies> |
Specifies the names of services or groups that must start before this service. The names are separated by forward slashes (/). |
||||||||||||||||
obj= {<AccountName> | <ObjectName>} |
Specifies a name of an account in which a service will run, or specifies a name of the Windows driver object in which the driver will run. The default setting is LocalSystem. |
||||||||||||||||
displayname= <DisplayName> |
Specifies a descriptive name for identifying the service in user interface programs. For example, the subkey name of one particular service is wuauserv, which has a more friendly display name of Automatic Updates. |
||||||||||||||||
password= <Password> |
Specifies a password. This is required if an account other than the LocalSystem account is used. |
||||||||||||||||
/? |
Displays help at the command prompt. |
Remarks
- For each command-line option (parameter), the equal sign is
part of the option name.
- A space is required between an option and its value (for
example, type= own. If the space is omitted, the
operation will fail.
Examples
To specify a binary path for the NEWSERVICE service, type:
sc config NewService binpath= "ntsd -d c:\windows\system32\NewServ.exe"