Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

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.

Become a Patron of Ask Leo! and go ad-free!

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

3 comments on “What Are Desktop.ini Files, and How Do I Get Rid of Them?”

  1. I keep all files on my computers visible. When I started doing that, and I began seeing these *.ini files everywhere (particularly on my desktop), and they kept coming back after I deleted them, I wanted to understand why. After some research, I learned that they hold settings I use for the folder they’re in, so I suppose there’s a *.ini file for each folder I customize (IIUC). At that point, I stopped trying to get rid of them, and just ignored them because I’d rather have all files visible in file explorer on my computer than to not see the various *.ini files that are strewn all over the place.

    Ernie

    Reply
  2. On my DeskTop, I move them to the lower right corner of the screen (so that they’re out of the way, and also largely out of sight), and then I ignore ’em.

    Reply

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.