How to tell the state of a service from the registry

1

1

Lets say for example I wanted to find out what state my bluetooth service is in from the registry:

  1. I'd open the registry using regedit
  2. Find the path: SYSTEM\CurrentControlSet\Services\BTHPORT

How could I tell if the bluetooth service is either, maunal, disabled, or enabled?

13aal

Posted 2017-04-12T19:10:47.730

Reputation: 153

Answers

3

Via the registry you won't be able to tell what state a service is currently in, only it's start-up mode setting (manual, automatic, disabled, etc.). This will be held in a key named "Start" within the service's branch in the registry.

Possible values:

+-------+----------------------------------------------------------------------------------------------------------------------------------+
| Value |                                                           Description                                                            |
+-------+----------------------------------------------------------------------------------------------------------------------------------+
|     0 | Boot: Loaded by kernel loader. Components of the driver stack for the boot (startup) volume must be loaded by the kernel loader. |
|     1 | System: Loaded by I/O subsystem. Specifies that the driver is loaded at kernel initialization.                                   |
|     2 | Automatic: Loaded by Service Control Manager. Specifies that the service is loaded or started automatically.                     |
|     3 | Manual: The service does not start until the user starts it manually, such as by using Services or Devices in Control Panel.     |
|     4 | Disabled: Specifies that the service should not be started.                                                                      |
+-------+----------------------------------------------------------------------------------------------------------------------------------+

If you're looking to get the current status of a service, consider using the sc command, or WMI to check the current status of a service.

Ƭᴇcʜιᴇ007

Posted 2017-04-12T19:10:47.730

Reputation: 103 763

This is perfect what I'm trying to do is query the registry for info, thank you – 13aal – 2017-04-12T19:40:34.187

1

The Start Type is stored in the Start key

The possible values are:

  • 0 - Boot
  • 1 - System
  • 2 - Automatic
  • 3 - Manual
  • 4 - Disabled

music2myear

Posted 2017-04-12T19:10:47.730

Reputation: 34 957