Disable a windows service from the command line

A quick command that I have used in a script to change the status of a service in Windows.

C:\> sc config “Spooler” start= disabled
[SC] ChangeServiceConfig SUCCESS

The start options are
start= <boot|system|auto|demand|disabled|delayed-auto>

auto–a service automatically started at boot time, even if no user logs on
boot–a device driver loaded by the boot loader
demand–a service that must be manually started (the default)
disabled–a service that can’t be started
system–a service started during kernel initialization

Changing more then one service at a time

Disables all services that start with the name VMware

C:\> wmic service where “caption like ‘VMware%’ and Startmode<>’Disabled'” call ChangeStartmode Disabled


This entry was posted in Scripting and tagged , , , . Bookmark the permalink.

One Response to Disable a windows service from the command line

  1. Andre says:


    I found that you need to double ‘%%’ the caption otherwise you get the “No instances” error because ‘%’ is a special character that needs to be escaped by adding a second %

    wmic service where “caption like ‘VMware%%’ and Startmode’Disabled’” call ChangeStartmode Disabled

Leave a Reply

Your email address will not be published. Required fields are marked *