Win32DiskImager is a Windows utility for writing raw disk images (.img and related files) to removable media (SD cards, USB flash drives) and reading devices back into image files.
This repository contains:
- A Qt-based GUI application (
Win32DiskImager.exe) - A native Windows CLI application (
Win32DiskImager-cli.exe) - A native Win32 API GUI scaffold (
native-win32-gui/) - A native Visual Studio CLI solution (
native-win32-cli/)
- This tool performs raw writes to physical disks.
- Selecting the wrong device can overwrite data on that device.
- Use it only when you are sure the selected target is correct.
- For CLI
read,write, andverify, run from an elevated (Administrator) terminal.
- Major improvement: Windows 11 compatibility (
WINVER/_WIN32_WINNTset to0x0A00) and updated library/toolchain support (Qt 6 + modern MinGW builds) - Write image file to a physical device
- Read physical device to image file
- Verify image against device
- Optional read limit in CLI (
--bytes) - Optional allocated-only read mode in CLI (
--allocated-only, MBR-based) - Image hash generation in GUI (MD5, SHA1, SHA256)
- Multi-language UI translations (
src/lang/*.ts)
- Windows
- Administrator rights for raw disk operations
- Qt qmake toolchain for GUI (
src/DiskImager.pro) - MinGW-w64 (
g++,mingw32-make) - Optional static Qt build for fully static GUI builds
The provided batch files expect a typical MSYS2 MinGW path:
C:\msys64\mingw64\bin
From repository root:
compile.batOutput:
bin\Win32DiskImager.exe
Open this solution in Visual Studio 2022 (or newer):
native-win32-gui\Win32DiskImagerNative.sln
Build target:
Debug|x64(orRelease|x64)
Output:
native-win32-gui\build\<Configuration>\<Platform>\Win32DiskImagerNative.exe
From repository root:
compile-cli.batOutput:
bin\Win32DiskImager-cli.exe
Open:
native-win32-cli\Win32DiskImagerCliNative.sln
Build target:
Debug|x64(orRelease|x64)
Output:
native-win32-cli\build\<Configuration>\<Platform>\Win32DiskImager-cli-native.exe
Set QT_STATIC_BIN first, then run:
set QT_STATIC_BIN=C:\Qt\6.x.x\mingw_64_static\bin
compile-gui-static.batOutput:
bin\Win32DiskImager.exe
Run Win32DiskImager.exe, then:
- Choose an image file.
- Select a target device.
- Choose
Write,Read, orVerify.
The GUI also supports:
- Drag/drop file path input
- Hash generation and copy
- Auto-refresh of removable devices
Usage:
Win32DiskImager-cli.exe list
Win32DiskImager-cli.exe write --device E: --image C:\path\image.img
Win32DiskImager-cli.exe read --device E: --image C:\path\backup.img [--bytes N] [--allocated-only]
Win32DiskImager-cli.exe verify --device E: --image C:\path\image.img
Examples:
Win32DiskImager-cli.exe list
Win32DiskImager-cli.exe write --device E: --image C:\images\raspi.img
Win32DiskImager-cli.exe read --device E: --image C:\images\backup.img --allocated-only
Win32DiskImager-cli.exe verify --device E: --image C:\images\raspi.imgDiskImagesDir: default folder used by the file pickerDiskImagerFiles: custom file filter list for image selection dialog (;;separated)
src/- main GUI and CLI sources, resources, translationssrc/DiskImager.pro- GUI qmake projectsrc/DiskImagerCli.pro- CLI qmake projectnative-win32-gui/- Visual Studio native Win32 GUI scaffoldnative-win32-cli/- Visual Studio native CLI solutioncompile.bat- GUI build helpercompile-cli.bat- CLI build helpercompile-gui-static.bat- static GUI build helpersetup.iss- Inno Setup installer scriptbin/- build outputs and packaged zip artifacts
- Project license: GNU GPL v2 (see
GPL-2) - Qt binaries/libraries used by builds may be under LGPL terms (see
LGPL-2.1) - Additional legal text:
License.txt
Legacy docs are still included:
README.txtDEVEL.txtCHANGELOG.mdandChangelog.txt