重灌系統後找不到啟動金鑰?預先備份兩個關鍵啟動檔案,重灌後一鍵還原自動啟動。
%windir%\System32\spp\tokens\pkeyconfig\pkeyconfig.xrm-ms%windir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat1. 備份啟動檔案.bat (以管理員身分執行):
@echo off copy %windir%\System32\spp\tokens\pkeyconfig\pkeyconfig.xrm-ms copy %windir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat pause exit
2. 還原啟動檔案.bat (以管理員身分執行,斷網環境下):
@echo off net stop sppsvc /y takeown /f "%WinDir%\System32\spp\tokens\pkeyconfig\pkeyconfig.xrm-ms" cacls "%WinDir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat" /e /g everyone:f cacls "%WinDir%\System32\spp\tokens\pkeyconfig\pkeyconfig.xrm-ms" /e /g everyone:f ren "%WinDir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat" "tokens.bak" ren "%WinDir%\System32\spp\tokens\pkeyconfig\pkeyconfig.xrm-ms" "pkeyconfig.bak" copy tokens.dat "%WinDir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\" copy pkeyconfig.xrm-ms "%WinDir%\System32\spp\tokens\pkeyconfig\" del "%WinDir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.bak" del "%WinDir%\System32\spp\tokens\pkeyconfig\pkeyconfig.bak" net start sppsvc cscript %windir%\system32\slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX cscript %windir%\system32\slmgr.vbs -ato pause exit
註:將 XXXXX-XXXXX-XXXXX-XXXXX-XXXXX 替換為原本啟動使用的金鑰。
原理: 直接還原軟體保護平台的金鑰設定與憑證檔案,配合 slmgr.vbs 重新安裝金鑰並啟動,繞過線上驗證。