
Disable Control Panel and Settings with Group Policy: the exact policy, its registry value, how to exempt admins and how to allow only some items.
How to delete a Windows service with sc delete or PowerShell, fix "marked for deletion", and what to check first. One PC or many.


Content writer, trio.so
To delete a Windows service, open Command Prompt as administrator and run sc delete ServiceName. A successful run prints "[SC] DeleteService SUCCESS". Before you run it, stop the service and back up its registry key, because a deleted service is gone until you restore it.
The command needs the service name, not the display name. Find it in a Command Prompt run as administrator:
sc query state= all | findstr /i "SERVICE_NAME DISPLAY_NAME"
Or in PowerShell:
Get-Service | Where-Object DisplayName -like "*vendor*" | Select-Object Name, DisplayName, Status
Check what the service runs:
sc qc ServiceName
Read BINARY_PATH_NAME and TYPE. A path in C:\Windows\System32 or a driver type means a Windows component. Do not delete those. Delete services that belong to software you have already uninstalled, or to an app you installed on purpose.
sc stop ServiceNamereg export HKLM\SYSTEM\CurrentControlSet\Services\ServiceName service-backup.regsc delete ServiceNamesc query ServiceName should answer that the service does not exist.The service disappears from the Services console when you refresh it, or after a restart.
PowerShell 6 and later has Remove-Service:
Remove-Service -Name "ServiceName"
Microsoft introduced it in PowerShell 6.0, so it does not exist in Windows PowerShell 5.1, the version built into Windows. In 5.1, call the executable, and write sc.exe with the extension, because sc alone is an alias for Set-Content in PowerShell:
sc.exe delete ServiceName
You can also use WMI: (Get-CimInstance Win32_Service -Filter "Name='ServiceName'") | Invoke-CimMethod -MethodName Delete.
Use sc.exe \\PCNAME delete ServiceName from an admin account that has rights on the remote PC, or run the command in a remote PowerShell session with Invoke-Command. Microsoft notes that the service cmdlets have no ComputerName parameter, so Invoke-Command is the route.
Error 1072 means the service is deleted but something still holds it open. Windows finishes the removal when the last handle closes.
services.msc), Computer Management, Event Viewer and Task Manager, which hold handles.sc queryex ServiceName, then taskkill /pid 1234 /f.Other errors:
If sc delete cannot do it, delete the key HKLM\SYSTEM\CurrentControlSet\Services\ServiceName and restart. Export the key first. Use this as a last resort. Deleting the key by hand skips the checks that sc delete runs.
Disabling is the safer first step: sc config ServiceName start= disabled (with the space after =). Leave the service disabled for a week. If nothing breaks, delete it. See also how to disable startup programs.
Put the stop, export and delete steps in a script and run it on a test PC first.
trio.so can run a script on enrolled Windows PCs from the console, and can start, stop and restart services on them. Deleting a service is still done by your script. See remote terminal.

Related reading: PowerShell execution policies and enable System Protection from the command prompt.
trio.so controls Windows services remotely on every managed PC, and runs scripts from the same console. Start a 14-day free trial.
trio.so brings device management, patching and security policies for Windows, macOS, Linux, iOS/iPadOS and Android into one console. Enroll a device and see it in the console within minutes.
trio.so brings device management, patching and security policies for Windows, macOS, Linux, iOS/iPadOS and Android into one console. Enroll a device and see it in the console within minutes.





Have questions? We've got answers. This section covers some of the most commonly asked questions related to this topic.
sc delete ServiceName in an administrator Command Prompt, after stopping the service and exporting its registry key.sc delete in Command Prompt, sc.exe delete in Windows PowerShell 5.1, or Remove-Service in PowerShell 6 and later.Related
The related industry news, interviews, technologies, and resources.

Disable Control Panel and Settings with Group Policy: the exact policy, its registry value, how to exempt admins and how to allow only some items.

Disable a GPO safely: disable the link, disable user or computer settings, or unlink it, and why to leave the Default Domain Controllers Policy alone.

Turn on Remote Desktop for Windows machines with Group Policy: the exact policy path, the firewall rule, NLA, and how to check it worked.

Windows 11 has no classic Guest account to switch on, but the hidden one can be disabled or deleted. Steps for one PC and for every PC by policy.

What is picture password in Windows 11? Read this blog to learn about its benefits, how to enable it, how to troubleshoot, and the best practices.

Get past "You must enable system protection on this drive". Turn on System Protection and run System Restore from the command prompt on Windows 10.

Back up files on Windows 10 and 11 from Command Prompt with robocopy, xcopy and wbadmin, plus a ready-to-use backup script you can schedule.

Turn off startup programs on Windows 10 and 11 with Task Manager and Settings, then by command prompt and PowerShell, and on many PCs at once.
14-day free trial. No credit card required.
trio.so for MSPs: one console, separate clients