Windows utility to set custom icons for drives and folders — with a built-in crop editor, live Explorer refresh, and cross-platform icon support.
- Set custom icons for any drive — C:\, D:\, USB drives, external HDDs, RAM disks
- Writes to Windows Registry (
HKLM\SOFTWARE\...\DriveIcons) for instant effect - Supports system drives (C:\) with ProgramData fallback — no root write errors
- Creates
autorun.inffor icon display on other Windows PCs - Cross-platform icon files included for portable drives:
- 🐧 Linux KDE/Dolphin —
.directory+drive_icon.png - 🐧 Linux GNOME/Nemo/Thunar —
.xdg-volume-info - 🍎 macOS —
.VolumeIcon.icns(structure prepared)
- 🐧 Linux KDE/Dolphin —
- Auto Eject after applying (USB/Removable drives)
- Removes icons cleanly — no leftover blank icon bug
- Set custom icons for any folder on your PC
- Creates
desktop.iniwith[.ShellClassInfo]automatically - Sets required folder
+S(System) attributes - Hides icon files with
+H+Sattributes (optional) - Stores icons in
%ProgramData%\FolderIconsfor safe keeping - Clean removal with full
desktop.inicleanup
- Drag to pan, scroll to zoom on the source image
- Real-time 256px preview + small sizes (48px, 32px, 16px)
- Background options: Transparent, White, Black, Circle crop
- High-quality LANCZOS resampling for final output
- Exports multi-resolution
.ico(256 / 128 / 64 / 48 / 32 / 16 px)
- Uses
SHChangeNotifyAPI — no Explorer kill/restart for drive icons - Sends
DRIVEREMOVED→DRIVEADDsequence to force full icon re-read - Flushes icon cache via
ie4uinit.exe -ClearIconCache - Fixes the common blank icon bug caused by stale
desktop.inientries
| Requirement | Details |
|---|---|
| OS | Windows 10 or Windows 11 |
| Python | 3.8 or newer |
| Pillow | Auto-installed on first run |
| Privileges | Administrator (for Registry writes) |
# Clone the repository
git clone https://github.com/Minta1234/DriveIconChanger.git
cd DriveIconChanger
# (Optional) Install Pillow manually
pip install PillowRight-click → Run as Administrator is recommended for full functionality.
python DriveIconSetter-V2.pyOr double-click DriveIconSetter-V2.py → choose "Run as administrator" if prompted.
Your image (PNG/JPG/ICO/etc.)
│
▼
[Crop Editor] ← drag, zoom, background options
│
▼
drive_icon.ico (multi-res: 256/128/64/48/32/16px)
│
├──→ Registry: HKLM\SOFTWARE\...\DriveIcons\{Letter}\DefaultIcon
├──→ %ProgramData%\DriveIcons\drive_{Letter}.ico
├──→ {Drive}\.icons\drive_icon.ico
├──→ {Drive}\.icons\drive_icon.png (Linux KDE)
├──→ {Drive}\.icons\drive_icon_512.png (Linux HiDPI)
├──→ {Drive}\desktop.ini (Windows Explorer)
├──→ {Drive}\autorun.inf (Other PCs)
├──→ {Drive}\.directory (Linux KDE/Dolphin)
└──→ {Drive}\.xdg-volume-info (Linux GNOME/Nemo)
Your image
│
▼
[Crop Editor]
│
▼
folder_icon.ico
│
├──→ %ProgramData%\FolderIcons\{FolderName}\folder_icon.ico
├──→ {Folder}\desktop.ini → [.ShellClassInfo] IconResource=...
└──→ attrib +S {Folder} (System flag — required by Windows)
drive-folder-icon-setter/
│
├── DriveIconSetter-V2.py # Main application (single-file)
└── README.md
The app is intentionally single-file for easy distribution.
| Item | Detail |
|---|---|
| GUI framework | tkinter (built into Python) |
| Image processing | Pillow (PIL) — auto-installed |
| Registry access | winreg (Python stdlib) |
| Shell notification | ctypes → SHChangeNotify |
| ICO export | Multi-res: 256/128/64/48/32/16 px |
| Theme | Catppuccin Mocha |
| Threading | Background pipeline, UI stays responsive |
- Windows only — the app will exit on Linux/macOS (by design; use the Linux edition for cross-platform management)
- System drive (C:\) icon changes require a PC restart to fully take effect in some cases
- GNOME Nautilus (modern) requires
gio setto be run from Linux — the Windows edition writes.xdg-volume-infoas a best-effort fallback .VolumeIcon.icns(macOS) structure is written but full ICNS generation is not yet implemented
- Full
.icnsgeneration for macOS icons - Batch apply icon to multiple folders at once
- Preset icon library / icon pack support
- Linux edition (GNOME
gio setsupport) - CLI mode (headless / scripting support)
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.
- Fork the repository
- Create your branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add my feature' - Push:
git push origin feature/my-feature - Open a Pull Request
Minta
GitHub: @Minta1234
Website: minta0077.online
Made with Minta0077