Skip to content

Advanced Topics

LinJHS edited this page Dec 20, 2025 · 1 revision

Advanced Topics

How it works

Win Folder Manager works by manipulating the standard Windows customization mechanism: the desktop.ini file.

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=Generic

System Attributes

For Windows Explorer to actually read and process this file, two conditions must be met:

  1. The desktop.ini file itself should be System (+s) and Hidden (+h).
  2. 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 Code

The core logic (in manager/logic.py) performs these steps:

  1. Removes +s +h from desktop.ini (to allow writing).
  2. Writes the new INI content (using utf-16 encoding with BOM, which is standard for Windows).
  3. Re-applies +s +h to desktop.ini.
  4. Toggles the folder's +r attribute (off then on) to force Explorer to refresh its cache for that folder.

Clone this wiki locally