作者:棋玉
問題背景:
如果替換過system 系統資料庫或者意外删除了服務,可嘗試通過系統資料庫恢複服務。
具體步驟:
服務對應的系統資料庫路徑是
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services<服務名稱>
,可嘗試以下步驟恢複服務:
1.将替換的原始系統資料庫load 起來,檢視服務的配置資訊
===========
a.cmd 指令行輸入 regedit
b.找到HKEY_LOCAL_MACHINE, 然後點選檔案,選擇加載配置單元。

c.找到之前替換的原始系統資料庫,比如system.old, 任意命名(例如test)。
d.展開test,檢視select 項,current 值為1, 則我們應該去找 ControlSet001.
展開ControlSet001,展開services,找到對應服務,以Google 更新服務 (gupdatem) 為例,先确認下各項屬性資訊
2.運作以下指令行建立服務
注意: binpath 對應ImagePath
type 對應類型和系統資料庫鍵值:
系統資料庫鍵值(Type) | 服務類型 |
---|---|
0x00000002 | filesys |
0x00000001 | kernel |
0x00000008 | rec |
0x00000010 | own |
0x00000020 | share |
0x00000100 | interact |
start 對應類型和系統資料庫鍵值:
系統資料庫鍵值(start) | 啟動類型 |
---|---|
0x00000000 | Boot |
system | |
auto | |
0x00000003 | manual |
0x00000004 | disabled |
error 對應ErrorControl,系統資料庫鍵值對應如下:
系統資料庫鍵值(ErrorControl) | error 類型 |
---|---|
ignore | |
normal | |
severe | |
critical |
depend 對應DependOnService,多個服務的話以/分隔。
有些系統資料庫項不在建立服務參數中,之後再手動添加即可。
sc create 的各項參數可以在指令行直接查詢: