This page looks best with JavaScript enabled

Customize Windows folder icon

 ·  ☕ 2 min read

Preface

When I install software, I usually install them to D:\Program Files
At the same time, the folder will be set to the relevant icon of the software


program folders with icons

I sometimes reinstall/restore the system, and I will install similar software every time
So I think I can pre-define the folder I want to modify and the icon path, and then hand it over to the program to complete it with one-click
After searching for information and testing, it should be feasible

How to customize folders

Right-click on the folder -> Properties -> Customize -> Folder icons/Change Icon.. -> Select your icon file (.ico or .exe) -> Apply
There will be a customize icon on the folder, enter the folder
You can find the desktop.ini (It’s a hidden system file, you must enable related settings to view it)

The desktop.ini is keypoint (How to Customize Folders with Desktop.ini)
We know that, desktop.ini need to include .ShellClassInfo Section and iconresource Key-Value

That will look like this, ,0 means 0th index icon

1
2
[.ShellClassInfo]
iconresource = D:\Program Files\Example_Program_1\favicon.ico,0

It’s not enough to just create the desktop.ini, you must assign relevant attributes, by attrib command

  • Folder must be Read-only
  • desktop.ini must have Archive, System, Hidden attributes

Automation program

I use Python programing language
You need to pre-define the relevant settings before running the program

Exe:GitHub
Code:GitHub

Define the software name and icon path that you want to customize the icon
e.g., settings.ini

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[Example_Program_1]
iconresource = \favicon.ico

[Example_Program_2]
iconresource = \bin\favicon.ico

[Example_Program_3]
iconresource = \icon.ico

[Example_Program_4]
iconresource = \Example_Program_4\bin\favicon.ico

[Example_Program_5]
iconresource = \hello.exe

The target folder structure is as follows

D:\Program Files
│
│
├─Example_Program_1
│      favicon.ico
│
├─Example_Program_2
│  │  file.txt
│  │
│  └─bin
│          favicon.ico
│
├─Example_Program_3
│      icon.ico
│
├─Example_Program_4
│  └─Example_Program_4
│      └─bin
│              favicon.ico
│
└─Example_Program_5
        favicon.ico
        hello.exe

Run the program, select D:\Program Files , The program will automatically customize the icons for Example_Program_1Example_Program_2Example_Program_3Example_Program_4Example_Program_5

Steps:

  1. Modify settings.ini

  2. Run windows-folder-icon-changer.exe

  3. Select the folder (e.g. Program Files)

  4. Select the settings.ini

  5. Wait for the program to finish


It’s work, but it is difficult to guarantee that there will be no problems
The exe file can be run on 64-bit Windows 10

DEMO


DEMO

Share on
Support the author with

JIHONGO
WRITTEN BY
JIHONGO
A Person