-
Notifications
You must be signed in to change notification settings - Fork 5
Advanced Topics
LinJHS edited this page Dec 20, 2025
·
1 revision
Win Folder Manager works by manipulating the standard Windows customization mechanism: the desktop.ini file.
When you customize a folder, Windows creates a hidden file named desktop.ini inside it.
A typical desktop.ini looks like this:
[.ShellClassInfo]
IconResource=..\Icons\my_icon.ico,0
LocalizedResourceName=My Friendly Name
InfoTip=This is a description.
[ViewState]
Mode=
Vid=
FolderType=GenericFor Windows Explorer to actually read and process this file, two conditions must be met:
- The
desktop.inifile itself should be System (+s) and Hidden (+h). - The Folder containing it must have the Read-Only (
+r) flag set.- Note: Setting a folder to Read-Only in Windows does not prevent you from writing files to it. It is simply a flag that tells Explorer "Hey, check for a desktop.ini file here!".
The core logic (in manager/logic.py) performs these steps:
- Removes
+s +hfromdesktop.ini(to allow writing). - Writes the new INI content (using
utf-16encoding with BOM, which is standard for Windows). - Re-applies
+s +htodesktop.ini. - Toggles the folder's
+rattribute (off then on) to force Explorer to refresh its cache for that folder.