This script automatically updates Windows folder icons by picking a random image from within each subfolder. It crops the image to a square, converts it to a high-quality .ico file, and handles the desktop.ini configuration and file attributes automatically.
- Cleanup: Removes any existing
folder_icon.icoordesktop.inifiles. - Selection: Randomly selects a
.jpg,.jpeg,.png, or.bmpfrom the subfolder. - Processing: Crops the image to 1:1 and resizes to 256x256.
- Configuration: Generates
desktop.iniand sets Windows System/Hidden attributes. - Refresh: Triggers a shell notification to update icons immediately.
-
Windows OS
-
Python 3.x
-
Pillow (PIL)
pip install Pillow
- Place
set_icons.pyin the root directory. - Run
run.batorpython set_icons.py.