You'll sleep better after reading this
Some people assume the Desktop.ini file is a virus or malware because it sometimes appears suddenly on their PC. Luckily, this isn’t the case, but if you’re wondering what Windows’ Desktop.ini file is, you’ve come to the right place.
In this article, we’ll cover what the Desktop.ini file is, how you can use it, and whether it’s safe to delete.
What Is the Desktop.ini File?
The Desktop.ini file is a hidden configuration file 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 as it’s a protected operating system file. If it’s suddenly appearing on your PC, you or another user have changed your folder settings to display hidden folders.
Desktop.ini files are created when specific changes are made to a folder, such as giving it 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:
- Open File Explorer.
- Select the View tab.
- Select Options.
- Select the View tab.
- Scroll down and check Show hidden files, folders, and drives.
- Scroll down further 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 have altered its 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 simply hide the Desktop.ini file by reversing the steps we showed you in the previous section.
How to Customize a Folder With the Desktop.ini File
Customizing a Windows folder with the Desktop.ini file is simple. First, you need to hide the folder and label it as an important system folder so that Windows grants it the required read-only attribute that enables special behavior from the Desktop.ini file.
To do so:
- Open or create the folder you would like to customize.
- Open the Start menu, then type Command Prompt and select it.
- In Command Prompt, type attrib +s “FolderName”. For example: attrib +s “C:\Test\TestFolder” and hit Enter.
Next, you need to create and edit the Desktop.ini file. To do so, you need to create a text file in the folder you would like to customize.
- At the top of the folder window, ensure that File name extensions are turned on.
- Right-click in your folder and select New > Text Document.
- Name it Desktop.ini and press Enter. A message box will appear asking you to check the file extension. Click Yes.
- Right-click the file you’ve just created and select Properties. Next to Attributes, tick Hidden and Read-only.
- Press OK.
- Double-click the file to open it in Notepad. Click File > Save As.
- For certain phrases/formatting to be picked up, the file needs to be saved in Unicode. At the bottom of the window, by Encoding, ensure 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]: This allows you to customize the folder’s view with the following entries.
- ConfirmFileOp: If this is set to “0”, you will not receive the warning when deleting or moving the folder.
- NoSharing: Setting this to “1” means that this folder cannot be shared.
- IconFile: Used to specify a custom folder icon or thumbnail image. To use this entry, you need to specify the path for the icon. The .ico format is preferred, but it will accept .bmp and .dll files too.
- IconResource: Similar to IconFile, this is used to specify the path for the icon. It appears instead of IconFile when manually selecting the icon from the folder’s properties.
- IconIndex: To specify a custom icon, this entry also needs to be present. If the folder containing your icon only has one icon, you can set it to 0.
- InfoTip: This entry adds an informational text string to the folder so that when hovering your cursor over it, a text box will appear.
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 you can use it to add custom folder options. While it isn’t particularly useful for most users, it’s always good to know that a mysterious hidden folder isn’t malware evading your antivirus.