Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal
- echo Backing up Windows Product Key...
- :: Get the Windows Product Key
- for /f "tokens=3" %%A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v BackupProductKeyDefault') do set ProductKey=%%A
- :: Save the product key to a text file
- echo Your Windows 10 Product Key: %ProductKey% > "%UserProfile%\Desktop\Windows_Product_Key_Backup.txt"
- echo Product key has been backed up to your Desktop as "Windows_Product_Key_Backup.txt".
- pause
- endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement