原文:http://typengine.com/content/windows-2008%E6%BF%80%E6%B4%BB%E6%96%87%E4%BB%B6%E5%A4%87%E4%BB%BD
@echo off
echo 请在管理员administrator下运行
echo. & pause
echo 备份原始激活文件到备份文件夹
md 备份
copy %windir%/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareLicensing/tokens.dat 备份/tokens.dat
copy %windir%/System32/licensing/pkeyconfig/pkeyconfig.xrm-ms 备份/pkeyconfig.xrm-ms
echo 关闭Software Licensing服务
net stop slsvc
echo 取得原始激活文件的权限并删除
takeown /f %windir%/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareLicensing/tokens.dat
takeown /f %windir%/System32/licensing/pkeyconfig/pkeyconfig.xrm-ms
cacls %windir%/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareLicensing/tokens.dat /t /e /g administrator:f
cacls %windir%/System32/licensing/pkeyconfig/pkeyconfig.xrm-ms /t /e /g administrator:f
del %windir%/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareLicensing/tokens.dat
del %windir%/System32/licensing/pkeyconfig/pkeyconfig.xrm-ms
echo copy激活文件到系统文件夹
copy tokens.dat %windir%/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareLicensing/tokens.dat
copy pkeyconfig.xrm-ms %windir%/System32/licensing/pkeyconfig/pkeyconfig.xrm-ms
echo 开启Software Licensing服务
net start slsvc
start %windir%/System32/licensing/pkeyconfig/
start %windir%/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareLicensing/
echo 更改产品密钥
SLMGR.VBS -ipk ***************************(key)
echo 完成激活!by 网虫
echo. & pause
对于Windows 2008 R2,需要备份的文件位置改变:
%windir%/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat
%windir%/System32/spp/tokens/pkeyconfig/pkeyconfig.xrm-ms