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 <server> delete [service name]
Parameters
| Parameter | Description |
|---|---|
<server> |
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 locally, don't use this parameter. |
<service name> |
Specifies the service name returned by the getkeyname operation. |
| /? | Displays help at the command prompt. |
Examples
To delete the service subkey NewServ from the registry on the local computer, type:
sc delete NewServ
Related links
Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
