How to Backup and Restore Windows License

Estimated Reading Time: 2 min

Rate this post

Batch Script to Backup and Restore Windows License

This script will backup your Windows license before reinstalling Windows and provide a way to restore it afterward.


Step 1: Backup Windows License

Save the following as backup_license.bat:

@echo off
echo Backing up Windows License...
mkdir %SystemDrive%\License-Backup
xcopy %SystemRoot%\System32\spp\store\* %SystemDrive%\License-Backup /E /H /C /I
echo License Backup Completed! Files saved in C:\License-Backup
pause

What This Script Does

  • Creates a backup folder in C:\License-Backup
  • Copies the Windows license activation files from C:\Windows\System32\spp\store\
  • Preserves all files and hidden attributes

Step 2: Restore Windows License

After reinstalling Windows, restore your license by saving this script as restore_license.bat:

@echo off
echo Restoring Windows License...
xcopy %SystemDrive%\License-Backup\* %SystemRoot%\System32\spp\store /E /H /C /I
echo Windows License Restored!
pause

What This Script Does

  • Copies the license backup back to its original location.
  • Ensures all files are restored correctly.

Step 3: Reactivate Windows

After restoring the backup, run this command manually in Command Prompt (Admin):

slmgr /ato
  • This forces Windows to re-check the restored activation.

How to Use These Scripts

  1. Before reinstalling Windows:
    • Run backup_license.bat
    • Copy the C:\License-Backup folder to a safe location (e.g., USB or external drive).
  2. After reinstalling Windows:
    • Copy License-Backup back to C:\
    • Run restore_license.bat
    • Run slmgr /ato to activate Windows.

Important Notes

✅ Works for OEM and Retail Windows licenses
✅ Does NOT work for Volume Licensing (Enterprise)
✅ Ensure you run these scripts as Administrator

Photo of author

Flora

How to Backup and Restore Windows License

Published

I am Flora, the publisher and founder of *Be-Smart*, a platform dedicated to sharing insights and inspiration for living a fulfilling life. With a strong background in the web, my goal is to empower people to genuinely recognize and celebrate admirable actions big or small in themselves and others.

Leave a Comment