What is the Windows Desktop.ini file and can I delete it?

Some people assume that the Desktop.ini file is a virus or malware because sometimes it suddenly appears on their PC. Thankfully it isn’t, but if you’re wondering what Windows Desktop.ini file is, you’ve come to the right place.

In this article, we will discuss what the Desktop.ini file is, how to use it, and whether it is safe to delete it.

What is Desktop.ini file?

The Desktop.ini file is a hidden configuration file that can be found in every folder on Microsoft Windows (including Vista and Windows 10/11). Each Desktop.ini file contains the configuration settings for that folder.

The Desktop.ini file is not visible by default because it is a protected operating system file. If it suddenly appears on your PC, you or another user has changed your folder settings to show hidden folders.

Desktop.ini files are created when specific changes are made to a folder, such as a custom icon or specific sharing settings.

How can I see the Desktop.ini file?

Desktop.ini files are hidden and protected, so the average user will never encounter them. To make them visible in your folder:

  1. Open Explorer
  2. Select the Vision tab.
  1. Select Options
  1. Select the Vision tab.
  1. Scroll down and check Show hidden files, folders and drives
  2. Scroll further down and uncheck Hide protected operating system files (recommended)† Select Yes to accept the warning message.

The Desktop.ini file should now appear in any folder where you’ve changed the configuration or layout.

Can I delete the Desktop.ini file?

Deleting the Desktop.ini file simply reverts a folder to its default settings. So yes, you can delete the Desktop.ini file. However, if you want to keep the changes you’ve made to a folder’s settings, you can easily hide the Desktop.ini file by reversing the steps we showed you in the previous section.

Customize a folder with the Desktop.ini file

Customizing a Windows folder with the Desktop.ini file is easy. First, you need to hide the folder and label it as an important system folder so that Windows gives it the required read-only attribute that enables special behavior of the Desktop.ini file.

To do this:

  1. Open or create the folder you want to modify.
  2. Open the Start menu and then type Command Prompt and select it.
  1. In the command prompt, type attrib +s “Folder name”† For example: attrib +s “C:\Test\TestFolder” and touch Enter

Next, you need to create and edit the Desktop.ini file. To do this, you need to create a text file in the folder you want to modify.

  1. At the top of the folder window, make sure: File name extensions are enabled.
  1. Right click in your folder and select New Text document
  1. You name it desktop.ini and press Enter† A message box will appear asking you to check the file extension. Click Yes
  1. Right click on the file you just created and select Properties† Next attributes, tick Hidden and Read only
  1. Press Okay
  2. Double-click the file to open it in Notepad. Click File Save as
  1. To pick up certain phrases/formatting, the file must be saved in Unicode. At the bottom of the window, by codingensure that UTF-8 is selected.

The Desktop.ini file is now ready to be populated with configuration settings. Here are some of the following settings you can use to customize your folder:

  • [.ShellClassInfo]† Allows you to customize the view of the folder with the following items.
  • ConfirmFileOn: If it is set to “0”, you will not get a warning when deleting or moving the folder.
  • Do not share: Setting this to “1” means this folder cannot be shared.
  • IconFile: Used to specify a custom folder icon or thumbnail image. To use this item, you must specify the path for the icon. The .ico format is preferred, but it also accepts .bmp and .dll files.
  • IconResource: As with IconFile, this is used to specify the path for the icon. It appears instead of IconFile when you manually select the icon in the folder’s properties.
  • IconIndex: To specify a custom icon, this item must also be present. If the folder with your icon has only one icon, you can set it to 0.
  • Info Tip: This item adds an informative text string to the folder so that a text box appears when you hover your cursor over it.

For example, here’s a test folder I created with a custom icon and InfoTip:

And here’s the Desktop.ini file used to customize it:

That’s all folks

Now you know what the Desktop.ini file is and how to use it to add custom folder options. Although not very useful for most users, it is always good to know that a mysterious hidden folder is not malware that evades your antivirus.

Leave a Reply

Your email address will not be published.