Desktop.ini files are hidden configuration files that Windows uses to customize how a folder appears in File Explorer, such as its icon, thumbnail, and tooltip. You don’t need to touch them normally, but if you want to change a folder’s icon or make a custom folder template, understanding them helps. This article explains what they are, how they work, and how to safely edit or remove them.
What Exactly Is a Desktop.ini File?
Every folder in Windows can have a desktop.ini file, but it only appears when the folder has been customized. It is a plain text file that stores settings in a format called INI (initialization). Windows reads it when you open the folder in File Explorer to apply special behaviors like:
- A custom folder icon (instead of the default yellow folder).
- A custom tooltip text that appears when you hover over the folder.
- A folder template (e.g., Pictures, Music, Videos) that changes the default view layout.
- Localized folder names in different languages.
These files are hidden by default. To see them, you must enable “Show hidden files” in File Explorer options, and also uncheck “Hide protected operating system files.” Even then, they are marked as system files, so they are easy to miss.
How Desktop.ini Files Work
When you right-click a folder, go to Properties, and change the icon or choose a template, Windows writes (or updates) the desktop.ini file in that folder. The file uses a simple structure with sections and key-value pairs. A typical desktop.ini looks like this:
[.ShellClassInfo] IconResource=C:\Icons\myicon.ico,0 InfoTip=My custom folder
Here, [.ShellClassInfo] is the section header. IconResource points to the icon file and the index (0 for the first icon in the file). InfoTip sets the hover text. Other common keys include FolderType (e.g., Pictures, Music) and LocalizedResourceName for a custom folder name.
The file must be saved as UTF-8 or UTF-16 with a BOM (Byte Order Mark) for Windows to read it correctly, especially if it contains non-ASCII characters. Windows also sets the file’s attributes to System and Hidden so it doesn’t clutter the folder view.
Why You Might Need to Edit One
Most users never need to touch desktop.ini files. Windows handles them automatically when you use the built-in folder customization options. However, there are a few situations where manual editing is useful:
- If you want to use a custom icon for a folder and the standard “Change Icon” button doesn’t work (e.g., for certain system folders).
- If you want to set a custom tooltip for a folder on a network share or a USB drive.
- If you want to force a specific folder template (like Music) on a folder that Windows keeps resetting to “General items.”
- If you are creating a portable app or a USB stick with a custom look and want the folder to look the same on any PC.
Editing is done with any text editor (like Notepad). You must first unhide the file, then edit, then save. After saving, Windows may need to refresh the folder view (F5) to apply changes.
Common Problems and Misconceptions
One of the most common questions is: “Is desktop.ini a virus?” The answer is no. It is a legitimate Windows file. However, some malware may create a file with a similar name or hide inside a folder with a desktop.ini to appear legitimate. Always check the file path and content if you are suspicious. A real desktop.ini is short and only contains folder settings.
Another issue is that desktop.ini files sometimes reappear after you delete them. That happens because Windows recreates them when you change a folder property (like its icon) or when the folder is part of a library (like Documents, Pictures). If you want to stop a folder from being customized, you can delete the desktop.ini and then reset the folder to default (right-click > Properties > Customize > Restore Default).
Also, if you copy a folder with a desktop.ini to another computer, the icon path may break because the icon file is not there. The folder will just show the default icon. To avoid this, keep the icon file in the same folder or use a relative path (though Windows usually stores absolute paths).
How to Create or Edit a Desktop.ini File
If you want to manually create or edit a desktop.ini, follow these steps:
- Open File Explorer and go to the folder you want to customize.
- Click “View” > “Options” > “Change folder and search options.”
- In the View tab, check “Show hidden files, folders, and drives” and uncheck “Hide protected operating system files.” Confirm the warning.
- Now you should see the desktop.ini file in the folder (if it exists). Right-click it and open with Notepad.
- Edit the content. For a simple custom icon, add or modify the
IconResourceline. For example:IconResource=C:\MyFolder\folder.ico,0 - Save the file. Make sure the encoding is UTF-8 (with BOM) if you use special characters.
- Right-click the folder > Properties > Customize > Change Icon to see if it takes effect. If not, press F5 to refresh.
Note: You must have the icon file available at the specified path. If you move the folder, the icon will break.
Desktop.ini vs. Other Hidden Files
Desktop.ini is often confused with other hidden files like Thumbs.db or autorun.inf. Here’s a quick comparison:
- Thumbs.db – a database of thumbnail images that Windows creates to speed up folder browsing. It is not a configuration file.
- autorun.inf – a file that tells Windows what to do when you insert a CD or USB drive. It can be a security risk, so Windows disables autorun by default.
- folder.ini – an older name for the same concept in Windows 9x. Modern Windows uses desktop.ini.
Unlike autorun.inf, desktop.ini is harmless and does not execute code. It only contains display settings.
Safety and Best Practices
Editing desktop.ini is safe if you know what you are doing. However, there are a few safety tips:
- Always back up the original file before editing.
- Do not change the
[.ShellClassInfo]section name or the key names; Windows expects them exactly. - Do not set
IconResourceto an executable file unless you are sure it is safe – some malware uses icon files to hide executables. - If you delete a desktop.ini, Windows will recreate it if you change any folder property. That is normal.
- If you are on a network share, the desktop.ini may not be read if the server does not allow hidden files to be served. That is a server setting, not a Windows client issue.
If you ever want to remove all customizations, delete the desktop.ini and then reset the folder’s customize settings via Properties > Customize > Restore Default.
Frequently Asked Questions
Is desktop.ini a virus?
No, desktop.ini is a legitimate Windows file used for folder customization. However, malware can hide in folders with names like desktop.ini.exe. Always check the file extension and location. A real desktop.ini is a text file, not an executable.
Why does desktop.ini keep coming back after I delete it?
Windows recreates it whenever you change a folder property (like icon, template, or name) through the Properties dialog. If you want to stop it, you need to reset the folder to default and then delete the file. Some system folders (like Libraries) always have a desktop.ini; you cannot delete it permanently.
Can I delete desktop.ini to save space?
You can, but it is typically less than 1 KB, so you won’t save any meaningful space. Deleting it will just remove the folder’s custom icon or template. Windows will recreate it if you change any folder property again.
How do I change a folder icon without editing desktop.ini?
Right-click the folder > Properties > Customize > Change Icon. Choose an icon from the list or browse to an .ico file. Windows will update the desktop.ini automatically. This is the recommended method for most users.
Why does my desktop.ini have a strange name like “desktop.ini:Zone.Identifier”?
That is an alternate data stream (ADS) that Windows adds when you download a file from the internet. It is not a separate file; it’s metadata attached to the desktop.ini. It is harmless and used by Windows to mark the file as coming from the internet. You can ignore it.
Can I use desktop.ini to change the folder name in another language?
Yes, you can use the LocalizedResourceName key. For example, LocalizedResourceName=@shell32.dll,-21770 would show the localized name for “Pictures.” But it’s easier to just rename the folder normally.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- China’s IPv9 Decimal Network Project Explained
- Fix Wired Earbuds That Only Work in One Ear
- What to Check Before Buying the Dip in Indian Shares
- Cool Raspberry Pi Projects: 15 Ideas for Any Skill Level3
- Terraform vs Kubernetes: Key Differences
- Internet Connectivity in Remote Areas: Options0.80 USD/GB