![如何从注册表中得知服务的状态](https://linux22.com/image/1527484/%E5%A6%82%E4%BD%95%E4%BB%8E%E6%B3%A8%E5%86%8C%E8%A1%A8%E4%B8%AD%E5%BE%97%E7%9F%A5%E6%9C%8D%E5%8A%A1%E7%9A%84%E7%8A%B6%E6%80%81.png)
举个例子,我想从注册表中找出我的蓝牙服务处于什么状态:
- 我会使用
regedit
- 查找路径:
SYSTEM\CurrentControlSet\Services\BTHPORT
我如何知道蓝牙服务是手动、禁用还是启用?
答案1
通过注册表,您无法知道服务当前处于什么状态,只能知道其启动模式设置(手动、自动、禁用等)。这些信息将保存在注册表中服务分支内名为“Start”的键中。
可能的值:
+-------+----------------------------------------------------------------------------------------------------------------------------------+
| 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. |
+-------+----------------------------------------------------------------------------------------------------------------------------------+
答案2
启动类型存储在Start
密钥中
可能的值包括:
- 0——启动
- 1 - 系统
- 2 - 自动
- 3 - 手册
- 4 - 已禁用