Can I Delete Desktop.ini? Yes, Here's What Happens
In this article
Yes, you can delete desktop.ini files, but they will come back, and deleting them is usually unnecessary. These hidden system files simply store folder view settings—like icon layout, background image, or custom sorting—and Windows regenerates them automatically when you change a folder's appearance.
What Exactly Is desktop.ini?
desktop.ini is a small, hidden text file that Windows uses to remember how a folder should look and behave. It is not a virus, and it is not part of the operating system's core. Every folder that has custom settings—such as a unique icon, a thumbnail view, or a localized name—contains one. Even folders without obvious customizations can have one if you have ever tweaked their view.
The file works by storing key-value pairs. For example, a folder with a custom icon might contain:
[.ShellClassInfo] IconResource=C:\Windows\System32\shell32.dll,3
This tells Explorer to display a specific icon. Other entries control whether the folder shows as a system folder, what tooltip text appears, or how the folder is sorted.
Why Does Windows Keep Creating It?
Windows creates desktop.ini automatically whenever you change a folder's view settings. Common triggers include:
- Changing the folder's icon (via Properties > Customize > Change Icon).
- Selecting a different folder template (e.g., Pictures, Music, Videos).
- Enabling or disabling "Show hidden files" and then refreshing the folder.
- Setting a folder to use a custom thumbnail or background image.
Even if you delete the file, the next time you modify the folder's appearance—or sometimes just by opening the folder in a new view—Windows will recreate it. This is by design; the file is a cache for Explorer's settings.
Is It Safe to Delete? What Happens If You Do?
Yes, it is safe to delete any desktop.ini file. Deleting it only removes the folder's custom view settings. The folder itself and its contents remain untouched. After deletion, the folder reverts to the default view—standard icon, no custom background, default sorting. If the folder had a custom name that was stored in the file (for example, a localized name like "My Documents" in another language), that name may revert to the actual folder name.
You will not break Windows, lose data, or cause any system errors. The only side effect is that you may need to reapply your preferred view settings if you care about them.
How to Delete desktop.ini (And How to See It First)
By default, desktop.ini is hidden. To see it, you must enable hidden files in File Explorer:
- Open File Explorer.
- Click the View tab at the top.
- In the Show/Hide group, check the box for Hidden items.
Once visible, you can delete it like any other file—right-click and choose Delete, or select it and press the Delete key. If you get a prompt about needing administrator permission, that means the file is marked as read-only or system-protected; you can still delete it by taking ownership, but it is rarely worth the trouble.
If you want to delete all desktop.ini files across your user profile at once, you can use a Command Prompt or PowerShell command, but be aware that many will regenerate immediately. A safer approach is to delete them only in folders where you actually want to reset the view.
When Should You NOT Delete It?
There are a few situations where deleting desktop.ini is not a good idea:
- If the folder is a system folder (like Desktop, Documents, or Downloads). These rely on
desktop.inifor proper display names and icons. Deleting it may cause the folder to appear with a generic name or lose its special icon, though it will not harm the system. - If you are trying to fix a folder view issue—deleting it can actually help reset a corrupted view, but only as a last resort after trying other fixes.
- If you are on a shared computer and the folder's custom view was set by an administrator or another user; deleting it may reset settings for everyone.
In most cases, the best advice is to simply leave the file alone. It takes up almost no space (usually under 1 KB) and causes no performance issues.
Common Misconceptions: Virus? Security Risk?
Many users worry that desktop.ini is malware. It is not. It is a legitimate Windows system file. However, malware can sometimes hide in a folder with a similar name, but the actual desktop.ini is always a plain text file. If you see a desktop.ini.exe or a file with a weird icon, that is a red flag—but a normal desktop.ini is harmless.
Another misconception is that deleting it speeds up your computer. It does not. The file is read only when you open the folder, and its size is negligible. Removing it will not free up meaningful disk space or improve performance.
How to Prevent It from Being Recreated
You cannot permanently prevent Windows from creating desktop.ini files. They are part of the operating system's design. However, you can minimize their creation by avoiding custom folder settings. If you never change icons, templates, or backgrounds, the file will rarely appear.
If you are cleaning up a drive and want to remove these files without them coming back immediately, you can delete them and then immediately set all folders to a default view. But even then, Windows may recreate them on the next Explorer restart. The most practical approach is to accept their presence—they are invisible by default and cause no harm.
Frequently Asked Questions
Can I delete desktop.ini from my USB drive?
Yes. USB drives often get desktop.ini files if you have changed the view of a folder on the drive. Deleting them is safe and will not affect the drive's data. The file will only reappear if you change folder settings again.
Why do I see desktop.ini on my desktop?
The Desktop folder itself has a desktop.ini that stores its icon and display name. It is normal. You can delete it, but the Desktop will still function; it may just lose its custom icon or name.
Is desktop.ini a virus?
No. It is a legitimate Windows file. If you are concerned, right-click it and open with Notepad—if it contains plain text like [.ShellClassInfo], it is genuine. If it is an executable file (ends in .exe), that is suspicious and should be scanned with antivirus.
Does deleting desktop.ini delete my files?
No. It only deletes the folder's view settings. Your actual files and folders inside remain completely intact.
How do I stop desktop.ini from appearing?
You cannot stop it from being created, but you can hide it again by unchecking "Hidden items" in the View tab. The file will stay hidden, which is how it is meant to be.
Can I delete desktop.ini from all folders at once?
Yes, you can use a command like del /s /q /f /a:h desktop.ini in Command Prompt, but many will regenerate. It is not recommended unless you have a specific reason, as it may reset view settings for many folders.