Advertisement
TechManDylan

dgs

Nov 8th, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. @echo off
  2. setlocal
  3. echo Backing up Windows Product Key...
  4.  
  5. :: Get the Windows Product Key
  6. for /f "tokens=3" %%A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v BackupProductKeyDefault') do set ProductKey=%%A
  7.  
  8. :: Save the product key to a text file
  9. echo Your Windows 10 Product Key: %ProductKey% > "%UserProfile%\Desktop\Windows_Product_Key_Backup.txt"
  10.  
  11. echo Product key has been backed up to your Desktop as "Windows_Product_Key_Backup.txt".
  12. pause
  13. endlocal
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement