Creating a Batch script to check Hardware IDs (HWID) is a common task for system administrators or users who need to generate a system fingerprint for licensing or inventory purposes.
Below is a helpful and safe Batch script that retrieves the most common hardware identifiers (Motherboard, CPU, BIOS, and Hard Disk) using standard Windows Management Instrumentation Command-line (WMIC) tools.
HWID_Checker.bat (make sure extension is .bat, not .txt).Modern Windows activation (Digital License) is tied to the HWID. If a user swaps a motherboard and Windows suddenly deactivates, running this script helps identify that the hardware fingerprint has changed.
Right-click on hwid checker.bat and select Run as Administrator. Note: Some hardware IDs (like disk serials) require admin privileges. hwid checker.bat
@echo off title System HWID Checker color 0Aecho ========================================== echo HARDWARE ID CHECKER echo ========================================== echo.
:: Check for Admin privileges (Required for some WMIC commands) net session >nul 2>&1 if %errorLevel% == 0 ( echo [Status] Running with Administrative Privileges... ) else ( echo [Warning] Admin privileges not detected. Some info may be missing. ) echo.
echo [Motherboard Information] echo ---------------------------------------------------------- :: Get Motherboard Serial Number for /f "skip=1 tokens=2 delims==" %%A in ('wmic baseboard get serialnumber /value') do set "MBSerial=%%A" echo Serial Number: %MBSerial% Creating a Batch script to check Hardware IDs
:: Get Motherboard Product Name for /f "skip=1 tokens=2 delims==" %%A in ('wmic baseboard get product /value') do set "MBProduct=%%A" echo Product Name: %MBProduct% echo.
echo [BIOS Information] echo ---------------------------------------------------------- :: Get BIOS Serial Number for /f "skip=1 tokens=2 delims==" %%A in ('wmic bios get serialnumber /value') do set "BIOSSerial=%%A" echo BIOS Serial: %BIOSSerial% echo.
echo [System UUID (Unique Hardware ID)] echo ---------------------------------------------------------- :: Get the System UUID for /f "skip=1 tokens=2 delims==" %%A in ('wmic csproduct get uuid /value') do set "HWID=%%A" echo UUID: %HWID% echo. Copy the code into Notepad
echo ========================================== echo END OF REPORT echo ========================================== pause
Example batch snippet:
@echo off
echo Machine GUID:
reg query "HKLM\SOFTWARE\Microsoft\Cryptography" /v MachineGuid
echo CPU ProcessorId:
wmic cpu get ProcessorId
echo Disk serials:
wmic diskdrive get serialnumber,model
echo BIOS serial:
wmic bios get serialnumber
echo UUID:
wmic csproduct get UUID
echo MAC addresses:
wmic nic where "MACAddress is not null" get Name,MACAddress
pause