What is the purpose of the "desktop.ini" file in Windows and how can I keep it from being generated?

It's not a big problem, but I'm comparing a lot of directories and desktop.ini keeps throwing off the total file size and file count. How can I make Windows stop generating it, and what does it do?


I found the answer: You can stop auto-generating desktop.ini files by unchecking "Remember each folder's view settings" in the Folder Options/View (or similar) settings. While this will not allow each folder to have its own unique size, view mode, etc., that's fine with me because I want all my folders to look and behave the same way.

"Hide protected operating system files" may treat the symptoms sometimes, but is not really a solution, because while the Windows OS may know to hide the files, other software (duplicate finding/synchronization, other OS's when this disk is shared) may not.


In Windows 7, this should work:

  1. Open the registry editor (Start → type regedit → hit Enter)
  2. Navigate to the following key:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
  3. Add a DWORD value UseDesktopIniCache (if it doesn't exist yet), and set its value to 0 (zero)

Source: Nevermore Be Bothered by Desktop.ini


It keeps the preferences for the layout of that folder. If there is any deviation from the standard layout of a folder, then a desktop.ini is created. You can hide it by selecting the "hide protected operating system files" option in windows explorer.