This post is an elaboration of the necessary steps in order to backup Windows 7 activation status before doing a clean re-install and then restoring it back, with the command lines instructions to do the tricky parts. Note that a valid key is required; this does not support piracy, it just saves you from increasing the activation count on a valid key just because you are doing a clean install.
They are based on a post on the following link : http://www.mydigitallife.info/how-to-backup-and-restore-windows-7-and-server-2008-r2-activation-status-activate-offline-on-reinstall/
- Copy and save or backup the following activation-related files to external storage medium such as USB flash drive or portable hard disk drive: C:\Windows\ServiceProfiles\NetWorkService\
Note: For 64-bit (x64) OS, C:\Windows\SysWOW64\spp\tokens\pkeyconfig\pkeyconfig.xrm-ms have to be backed up too.
- Retrieve and record the product key used to install and activate the current Windows 7 or Windows Server 2008 R2.
- Reinstall Windows 7 or Windows Server 2008 R2. When installation wizard prompts for a product key for activation, leave it blank (do not enter anything).
- In the newly installed Windows operating system, stop the Software Protection Service in Services.msc or with the following command (run in elevated command prompt):
- Navigate to the following folder:C:\Windows\System32\spp\tokens\pkeyconfig\
- Take ownership and give user full control permissions (alternatively add grant full control right click menu item) to pkeyconfig.xrm-ms file.
- Delete the original default pkeyconfig.xrm-ms file, and replace with the backup copy.
- Note: In 64-bit (x64) operating system, also perform the above actions in C:\Windows\SysWOW64\spp\tokens\pkeyconfig\ folder.
takeown /f *
- Navigate to the following folder:C:\Windows\ServiceProfiles\NetWorkService\
- Take ownership and give user full control permissions (alternatively add grant full control right click menu item) to tokens.dat file.
- Delete the original default tokens.dat file, and replace with the backup copy.
- Restart the Software Protection Service in Services.msc or with the following command (run in elevated command prompt):
net start sppsvc
- Register the product key for Windows 7 or Windows Server 2008 R2 with the following command (run in elevated command prompt):
slmgr.vbs -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Replace xxxxx-xxxxx-xxxxx-xxxxx-xxxxx with the actual product key.
- Windows will activated instantly, off-line. To check activation status, uses of of the following commands:
- slmgr.vbs -dlv
- slmgr.vbs -dli
- slmgr.vbs -ato