84

I want to disable a Windows service but I don't want to:

  1. Open the "Services" management console
  2. Scroll to the name of the service
  3. Right-click Properties (or double-click)
  4. Change the Startup Type: to disabled
  5. Apply
  6. Click "Stop"

I don't want to remove a Windows service but instead, just disable it.

Kevin Driedger
  • 2,875
  • 3
  • 21
  • 19

4 Answers4

127
sc config "Name of Service" start= disabled
sc stop "Name of Service"

The space after the "start=" is important

You can see service name by double clicking a service on Services screen:

Service Name

JonathanDavidArndt
  • 1,344
  • 7
  • 25
  • 42
Kevin Driedger
  • 2,875
  • 3
  • 21
  • 19
24

SC STOP "<nameservice>"

SC CONFIG "<nameservice>" START= ( BOOT, or SYSTEM, or AUTO, or DEMAND, or DISABLED, or DELAYED-AUTO )

Link: Sc config

Greenonline
  • 2,235
  • 11
  • 24
  • 30
Marc
  • 259
  • 2
  • 2
  • 6
    How does this differ from the highest voted answer from five years ago? – Greenonline Jun 09 '17 at 16:59
  • 7
    @Greenonline: actually it differs, Marc has provided full argument list plus the link to help page. Don't down vote useful stuff. – SoLaR Aug 15 '17 at 07:28
  • This is, actually, the right way to manage services. Specially in windows 10. Some direct changes on registry services group or using WMI sometimes does not work. Like changing dependency of a service. SC is the correct official way to modify services. Thanks! – DefToneR Dec 13 '21 at 18:40
21

In addition to Kevin's answer, if you need to control more than one service, or select them based on some criteria, you can use wmic. Simple use to stop only 1 service (Sqlwriter in my example) would be:
wmic service where name='SQLWriter' call ChangeStartmode Disabled

but the tool is much more powerful, for example to set disabled mode for all services with caption starting with SQL and not already disabled you could say:

wmic service where "caption like 'SQL%' and  Startmode<>'Disabled'" call ChangeStartmode Disabled
wmz
  • 7,102
  • 1
  • 21
  • 32
-1

Quoting from KB248660:

The Reg.exe utility from the Microsoft Windows NT Resource Kit must be installed on your computer.

To change the startup value for a service on a local computer by using the command line, type the following at the command prompt and then press ENTER: REG UPDATE HKLM\SYSTEM\CurrentControlSet\Services\servicename\Start=X where servicename is the name of the service as it appears in the registry and X is either a 2, a 3, or a 4 (representing automatic startup, manual startup, or disabled, respectively).

To change the startup value for a service on a remote computer by using the command line locally, type the following at the command prompt and press ENTER: REG UPDATE HKLM\SYSTEM\CurrentControlSet\Services\servicename\Start=X \servername where servicename is the name of the service as it appears in the registry, X is either a 2, a 3, or a 4 (representing automatic startup, manual startup, or disabled, respectively), and servername is the name of the remote server.

To see how the service name appears in the registry, view the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

darnir
  • 732
  • 5
  • 18
  • 2
    Bad idea. You can disable service using REG utility but service manager isn't updated. Service can still be run by service manager until service manager refreshes the internal list - tested this moment and service still starts with disabled flag == Started (Disabled). – SoLaR Aug 15 '17 at 07:30
  • This is a brute force method. Microsoft provides a command line tool which includes documentation. Plus there is a Windows API that provides a similar interface, should you ever need to call it from code. PowerShell also has similar extension for controlling services. All of which I find easier to use than RegEdit. – ripvlan Feb 17 '23 at 17:40