萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 作業系統 >  >> Windows 7 教學

如何備份 Win7 系統啟用資訊?重灌後免序號直接還原啟用

重灌系統最頭痛的就是重新啟用 Windows。透過批次檔備份與還原啟用相關檔案(tokens.dat 與 pkeyconfig.xrm-ms),重灌後即可離線自動完成啟用,省去輸入產品金鑰與網路驗證的麻煩。

備份啟用檔案示意

一、建立兩個批次檔

1. 備份啟用檔案.bat

將下列內容複製到記事本,另存為 備份啟用檔案.bat:

@echo off
copy %windir%\System32\spp\tokens\pkeyconfig\pkeyconfig.xrm-ms %~dp0
copy %windir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat %~dp0
pause
exit

2. 還原啟用檔案.bat

將下列內容複製到記事本,**將 XXXXX-XXXXX-XXXXX-XXXXX-XXXXX 替換為您的 Win7 產品金鑰**,另存為 還原啟用檔案.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

二、使用方式

  1. 將兩個 .bat 檔放在同一資料夾(任意磁碟)。
  2. **重灌前**:以系統管理員身分執行 備份啟用檔案.bat,資料夾會產生 tokens.dat 與 pkeyconfig.xrm-ms 兩個備份檔。
  3. **重灌後**(斷網狀態下):以系統管理員身分執行 還原啟用檔案.bat,系統即可自動完成啟用。

注意事項

  • 此法適用於相同版本(如同為旗艦版)且硬體變動不大的情況。
  • 備份檔案請妥善保存,避免遺失或被竄改。
  • 若硬體大幅變更(如換主機板),可能仍需重新線上啟用。
copyright © 萬盛學電腦網 all rights reserved