text
stringlengths
0
4.23k
Specifies the service name returned by the getkeyname operation.
type= {own \| share \| kernel \| filesys \| rec \| interact type= {own \| share}}
Specifies the service type. The options include:own - Specifies a service that runs in its own process. It doesn't share an executable file with other services. This is the default value.share - Specifies a service that runs as a shared process. It shares an executable file with other services.kernel - Specifies a driv...
start= {boot \| system \| auto \| demand \| disabled \| delayed-auto}
Specifies the start type for the service. The options include:boot - Specifies a device driver that is loaded by the boot loader.system - Specifies a device driver that is started during kernel initialization.auto - Specifies a service that automatically starts each time the computer is restarted and runs even if no on...
error= {normal \| severe \| critical \| ignore}
Specifies the severity of the error if the service fails to start when the computer is started. The options include:normal - Specifies that the error is logged and a message box is displayed, informing the user that a service has failed to start. Startup will continue. This is the default setting.severe - Specifies tha...
binpath= <binarypathname>
Specifies a path to the service binary file. There is no default for binpath=, and this string must be supplied.
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 friendly 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.
<servername>
<servicename>
type= {own \| share \| kernel \| filesys \| rec \| 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>
Remarks
Each command-line option (parameter) must include the equal sign as 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 fails.
Examples
To create and register a new binary path for the NewService service, type:
sc.exe \\myserver create NewService binpath= c:\windows\system32\NewServ.exe
sc.exe create NewService binpath= c:\windows\system32\NewServ.exe type= share start= auto depend= +TDI NetBIOS
To learn more about the sc.exe command, see SC commands.
sc.exe
sc.exe delete
Deletes a service subkey from the registry. If the service is running or if another process has an open handle to the service, the service is marked for deletion.
Note
We don't recommend you to use this command to delete built-in operating system services such as DHCP, DNS, or Internet Information Services. To install, remove, or reconfigure operating system roles, services and components, see Install or Uninstall Roles, Role Services, or Features
Syntax
sc.exe [<servername>] delete [<servicename>]
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, don't use this parameter.
<servicename>
Specifies the service name returned by the getkeyname operation.
/?
Displays help at the command prompt.
<servername>
<servicename>