Delete a Windows Service with the Command Line or PowerShell

In this post, I’ll demonstrate using the sc delete Windows command and the Remove-Service PowerShell command to delete a Windows Service.

How to Delete a Windows Service from the Command Line

Step 1. Find the Service Name

Open Windows Services, find the service name, right click and select properties.

Copy the service name.

Step 2. Run the sc delete command

Open the command line as administrator.

Next, run the below command. Replace “servicename” with the service name from Step 1.

sc delete servicename

You should get DeleteService SUCCESS message.

You might need to reboot the computer for the service to be completely removed.

That completes the steps for deleting a windows service using the sc command.

How to Delete a Windows Service Using PowerShell

Requirements: You will need to be running at least PowerShell version 6 for this command to work. Refer to the updating PowerShell guide for steps on upgrading PowerShell to the latest version.

Step 1. You will need the service name

Open Windows services and get the service name. If you need to see screenshots see the Windows command line example.

Step 2. Run Remote-Service PowerShell command.

Open PowerShell as administrator and run the below command. Replace servicename with the name found in Step 1.

Remove-Service -Name servicename

Note: I’m not sure why but the PowerShell command removed the service without requiring a reboot. The sc delete command required a reboot. It might depend on the service but just be aware you might need to reboot.

If you liked this post, you might also want to check out:

Leave a Comment