Created
May 9, 2026 15:10
-
-
Save PowerX-NOT/dbffb0e9a698235444967f6d8682a89c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| :: =========================================== | |
| :: Windows Machine GUID Reset Script | |
| :: Run as Administrator | |
| :: =========================================== | |
| :: Check for admin privileges | |
| net session >nul 2>&1 | |
| if %errorLevel% neq 0 ( | |
| echo [ERROR] Please run this script as Administrator | |
| pause | |
| exit /b | |
| ) | |
| echo ------------------------------------------- | |
| echo [INFO] Displaying current Machine GUID... | |
| for /f "tokens=3" %%A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography" /v MachineGuid ^| find "MachineGuid"') do ( | |
| set OLD_GUID=%%A | |
| ) | |
| echo [OLD MACHINE GUID] %OLD_GUID% | |
| echo ------------------------------------------- | |
| echo [INFO] Generating new Machine GUID... | |
| :: Generate a random GUID using PowerShell | |
| for /f %%G in ('powershell -Command "[guid]::NewGuid().ToString()"') do ( | |
| set NEW_GUID=%%G | |
| ) | |
| :: Update registry value | |
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography" /v MachineGuid /t REG_SZ /d %NEW_GUID% /f >nul | |
| echo ------------------------------------------- | |
| echo [NEW MACHINE GUID] %NEW_GUID% | |
| echo [SUCCESS] Machine GUID has been reset. | |
| echo. | |
| echo [INFO] Restart your PC for changes to fully apply. | |
| pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment