Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 7 激活檔案備份教學:重裝系統後自動激活

編輯:Win7 系統基礎知識

許多 Windows 7 用戶在重裝系統後面臨激活難題:若未保存原本的產品金鑰,要尋找有效的激活碼並非易事。本文將教導您如何備份 Windows 7 的激活相關檔案,讓重裝系統後能自動完成激活,省去輸入金鑰的麻煩。

製作兩個批次檔

1. 備份激活檔案批次檔

請將以下程式碼複製到記事本,並另存為 備份激活檔案.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. 還原激活檔案批次檔

同樣複製下列內容到記事本,將 XXXXX-XXXXX-XXXXX-XXXXX-XXXXX 替換為您原本激活時使用的產品金鑰,另存為 還原激活檔案.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 檔案放在同一資料夾。以系統管理員身分執行「備份激活檔案.bat」,即可獲得兩個激活檔案的備份(tokens.dat 與 pkeyconfig.xrm-ms)。
  2. 重裝作業系統後,在斷網環境下(切勿連網),以系統管理員身分執行「還原激活檔案.bat」,系統即可自動完成激活。

依照上述步驟操作,日後每次重裝 Windows 7 只需這兩個批次檔即可輕鬆激活,無需再煩惱金鑰遺失問題。

Copyright © Windows教程網 All Rights Reserved