What Are Desktop.ini Files, and How Do I Get Rid of Them?

They’re Windows being helpful.

Invisible or not, they'll be there.
desktop.ini
(Screenshot: askleo.com)
Question: What bugs me most of all is the “desktop.ini” files generated by Windows. I DON’T WANT THEM! I’m forever deleting them!

Your name isn’t Sisyphus, is it? Just like Sisyphus is doomed to push a rock up a hill for all eternity, you’ll be deleting desktop.ini files forever. They’ll just keep coming back.

To understand why, we’ll look at what desktop.ini files do.

TL;DR:

desktop.ini files

Desktop.ini files are hidden files used by Windows to store folder display settings. Deleting them is futile; they’ll just come back when folder settings change. To avoid seeing them, adjust Windows File Explorer settings to hide hidden and protected system files. Ignoring them is by far the simplest solution.

Desktop.ini

A desktop.ini file is nothing more than a text file that contains information about how Windows should display the folder in which it’s located. Here’s a random example:

[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769
IconResource=%SystemRoot%\system32\imageres.dll,-183

The files can contain several settings. A simple example is “IconResource”, shown above. It indicates the icon that should be displayed when the folder is shown in Windows File Explorer. Change that icon (via Folder Properties), and this line is updated to reflect your new choice.

Why you might not see them at all

Desktop.ini files are hidden by default. The only way to see them is to “Show hidden files, folders, and drives” and turn off the “Hide protected operating system files” in Windows File Explorer’s settings.

How to show desktop.ini files
How to see desktop.ini files. (Screenshot: askleo.com)

(Or use the “/A:H” switch with the DIR command if you’re looking within Command Prompt.)

Once those are set, you’ll see desktop.ini files in assorted locations.

desktop.ini file in the wild
A desktop.ini file in Windows File Explorer. Click for larger image. (Screenshot: askleo.com)

Why you might see two

You’ll see two desktop.ini files on the desktop.

Two desktop.ini files.
Two desktop.ini files on the desktop. (Screenshot: askleo.com)

Your computer’s desktop is a combination of two folders. In the example above, the desktop shows information from:

  • C:\Users\leon\Desktop

and

  • C:\Users\Public\Desktop

All users of the computer are shown items from the Public folder as well as their own.

But they’re still two folders. Two folders means two desktop.ini files.

Delete all you want; we’ll make more

It’s generally safe to delete desktop.ini files. But it’s kinda pointless.

Two things will happen:

  • The settings defined within the desktop.ini file will be reset to default values.
  • The next time a setting changes, the desktop.ini file will be recreated.

Resistance is, as they say, futile.

Suddenly appearing desktop.ini files

If you’ve never seen desktop.ini files and suddenly see them everywhere, then the “hide” options in Windows File Explorer have been changed to allow them to be seen.

If you have desktop.ini files displayed in some places but now see one in a new place, then some kind of setting for that folder has been applied, and a desktop.ini was created to hold it.

Do this

Delete ’em if you like, but desktop.ini files will come back. My advice is to ignore them if you see them. If you’re so inclined, set Windows File Explorer options to hide them from view.

Don’t hide this: subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.

Podcast audio

Play

Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.