Windows creates desktop.ini to store folder view settings; it shows up when hidden or system files are visible or when its attributes got changed.
What Desktop.ini Does
Desktop.ini is a small configuration file that tells File Explorer how a folder should look and behave. It can set a custom icon, a localized folder name, and a few view tweaks. Windows reads this file when a folder carries special attributes, then applies those rules to the way the folder appears. You can see the official method for these tweaks in Microsoft’s guide to customize folders with desktop.ini.
On the Desktop, Windows usually keeps one desktop.ini in the user Desktop folder and another for the Public Desktop. Both are flagged as hidden and system, so in a normal setup you never see them at all.
What’s Inside Desktop.ini
The file holds simple directives. A typical copy looks like this:
[.ShellClassInfo]
IconResource=C:\Windows\System32\SHELL32.dll,27
IconFile=folder.ico
IconIndex=0
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21770
Those lines tell File Explorer which icon to display and how to label the folder. The file can also hold a short tooltip and other view hints supported by the shell. It does not run code and does not launch apps.
Why Windows Hides It
Windows marks files like desktop.ini with Hidden and System flags so regular browsing stays tidy. The point is to protect small configuration items from accidental edits or deletion. That is why the option reads “Hide protected operating system files.” If that box is checked, system files remain out of sight even when you show hidden items. Microsoft’s File Explorer page lists both switches and where to find them.
Why Desktop.ini Shows On The Desktop
When desktop.ini becomes visible, something changed in settings or attributes. The file itself is not new; you are just seeing it. Here are the common triggers that surface the file on the Desktop and across folders.
| Cause | What You’ll Notice | Quick Fix |
|---|---|---|
| You turned on “Show hidden items” | Hidden files across the drive become visible | Turn the toggle off in File Explorer’s View > Show menu |
| “Hide protected operating system files” is off | System files like desktop.ini appear even if hidden items are off | Open Folder Options and re-enable the protection setting |
| Attributes were removed | A plain desktop.ini icon sits on the Desktop | Restore Hidden and System flags with the attrib command |
| Cloud sync or zip tools rewrote files | desktop.ini loses flags after a sync or extract | Reapply attributes or refresh the folder view |
| Third-party cleaners changed folder view settings | Many folders start showing desktop.ini files | Undo the tweak or reset File Explorer options |
Two toggles control visibility. “Hidden items” shows files with the Hidden flag. A second, separate switch controls files flagged as System. Microsoft’s File Explorer page shows where those choices live in Windows 10 and 11 under View > Show and in Folder Options > View tab (File Explorer in Windows).
Accidental Setting Change
It is easy to trigger this while troubleshooting. One click on View > Show > Hidden items reveals every hidden file. A second click in Folder Options unchecks the operating system protection box. That combo exposes desktop.ini on the Desktop, in Documents, and in many system folders. If you only needed the view for a one-off task, turn both switches back off.
Attribute Loss During Copy Or Sync
Some tools copy the text of a file but drop flags. When that happens, desktop.ini looks like a normal file and keeps showing even when the protection switch is on. Set the flags again with attrib or delete the stray copy and refresh the folder.
Fresh Install Or New Profile
On a new machine, you might see a single desktop.ini for a day or two while Windows sets up the profile shell folders. After attributes settle and the protection switch is on, it disappears from view.
Is Desktop.ini Dangerous Or A Virus?
No. The file is a standard part of Windows and contains plain text. Deleting it does not remove malware, and creating it does not introduce a threat. That said, an attacker could drop a file with the same name in an unrelated folder, but the name alone tells you nothing. Treat it like any other file: check the location and scan if something feels off. The normal copies sit in your Desktop folders and many system folders, all with the Hidden and System flags.
Fixing Desktop.ini Appearing On Startup
If desktop.ini pops up each time you log in, the file is visible or its flags changed. Use the steps below to put it back out of view.
Hide It With File Explorer Options
- Open File Explorer.
- Select View > Show and turn off Hidden items.
- Click the three dots > Options. In the View tab, check Hide protected operating system files (Recommended) and apply.
Those controls come from Microsoft’s support instructions for File Explorer and apply to Windows 11 and Windows 10 (official guide).
Restore Hidden And System Attributes
If visibility returns after a reboot, the file may have lost its attributes. You can set them back with attrib in an admin Terminal or Command Prompt.
attrib +h +s "%UserProfile%\Desktop\desktop.ini"
attrib +h +s "C:\Users\Public\Desktop\desktop.ini"
The syntax for attrib is documented by Microsoft (attrib command). The +h sets Hidden; +s sets System.
Stop Tools From Turning The Setting On
Some cleanup apps, backup tools, or registry tweak kits switch on “show hidden items” during a task and leave it that way. Open File Explorer Options and reset the view to defaults. If a tool keeps flipping the switch, set your preference after each run or change that tool’s setting.
Reset Folder Views
- Open File Explorer Options.
- On the View tab, choose Reset Folders to clear custom templates.
- Select Restore Defaults to bring back the standard set of switches.
After a reset, apply the protection box again and close File Explorer windows to reload the view engine.
Command Checks
To confirm the flags, open an admin Terminal and run:
dir /a "%UserProfile%\Desktop"
attrib "%UserProfile%\Desktop\desktop.ini"
The first command lists all files, including hidden ones. The second prints the attributes for desktop.ini. You should see H and S in the output after running the restore commands.
Deleting Desktop.ini: Safe Or Not?
Deleting the file does not break Windows. It removes folder cosmetic choices: a custom icon, a localized display name, and similar tweaks. In many folders, Windows recreates desktop.ini when a change needs it. On the Desktop, the file often comes back after the next sign-in.
When Deleting Makes Sense
- A leftover file sits on the Desktop with no flags even after you hide system files. Delete it and then refresh the view.
- You reset a folder to default view and want to clear old custom rules. Deleting desktop.ini finishes the reset.
When You Should Not Delete
- Special folders that ship with a custom icon or a localized name, such as Documents or Downloads. Removing desktop.ini removes that branding and the file will likely reappear anyway.
- Shared folders where other users expect a branded icon. Keep the file to avoid confusion.
Action And Effect Summary
| Action | What Changes | Side Effects |
|---|---|---|
| Hide protected OS files | desktop.ini and similar files vanish from view | You won’t see system items while troubleshooting |
Run attrib +h +s on desktop.ini |
Restores Hidden and System flags | Requires admin for some paths |
| Delete desktop.ini | Removes folder cosmetic settings | Icons or localized names may revert; file may return later |
| Leave it as is | No change to the folder | The file stays visible if view settings show it |
Common Misconceptions
“Desktop.ini Slows My PC”
The file is a few bytes of text. File Explorer reads it when drawing a folder, then moves on. It does not add startup time or drain resources.
“It Is The Same As Thumbs.db”
No. thumbs.db caches thumbnails for quick image previews. desktop.ini stores folder view rules. They serve different jobs.
“Deleting It Stops It Forever”
If a folder picks up a custom icon or a special template, Windows can create a new desktop.ini to store those settings. That is normal. Hiding system files is the tidy fix.
Short Guide For Windows 10 And Windows 11
Windows 11 Steps
- Open File Explorer and tap View > Show. Turn off Hidden items.
- Select the three dots > Options. Go to the View tab.
- Check Hide protected operating system files, then click OK.
Windows 10 Steps
- Open any folder and pick View on the ribbon. Turn off Hidden items.
- Choose Options > Change folder and search options.
- On the View tab, check Hide protected operating system files and apply.
If The File Reappears Later
When desktop.ini returns after a sync, a cleanup, or a restore, it often means the tool removed attributes or changed the folder template again. Run the two attrib lines, reapply Folder Options, then sign out and back in. If a corporate policy forces hidden items on, you may need admin help to change that policy on managed PCs.
Extra Notes For Power Users
Attributes And Re-Creation
Windows checks a folder’s flags to decide when to use desktop.ini. When a folder is marked Read-only or System, File Explorer looks for the file and reads any rules inside. If the file is missing but a tweak calls for it, Windows creates it and sets the proper flags again. That design keeps view rules portable across machines. Microsoft’s developer page shows how desktop.ini stores settings like [.ShellClassInfo] and icon paths (desktop.ini reference).
Two Desktop.ini Files On The Desktop
Many PCs have one desktop.ini in the user profile Desktop and another in the Public Desktop. The shell merges those folders into one canvas, so both copies can exist. If you run the attrib commands above on both paths, they stay hidden.
Cloud Sync And Archive Tools
Some sync clients and zip tools copy files without preserving attributes. After a restore or extract, desktop.ini can come back as a normal file. Reapply the flags with attrib and refresh File Explorer. If a cloud app mirrors the Desktop to a web drive, it may also bring the file into search or mobile views; that is expected and harmless.
Editing Desktop.ini The Right Way
If you need a custom folder icon or name, follow Microsoft’s method instead of hand-editing lines. The steps in the official desktop.ini article show the supported keys and where to place the icon file. This keeps attributes aligned and avoids stray files.
Quick Troubleshooting Checklist
Desktop.ini Still Visible?
- Open File Explorer Options and turn on “Hide protected operating system files”.
- Turn off “Hidden items” unless you truly need hidden files visible.
- Run the two
attriblines to restore the flags on both Desktop paths. - Refresh the Desktop or sign out and sign back in.
Folders Everywhere Show desktop.ini?
- Reset Folder Options to defaults, then apply.
- Undo tweaks in any cleaner or “tune up” app that changes view switches.
- If a synced Desktop keeps surfacing the file, set the flags again and let the client rescan.
Want A Custom Icon But Not The File?
You can’t hide the mechanism that stores the rule. The supported path is to keep desktop.ini hidden and system-flagged so it can do its job out of sight. Use Microsoft’s guide to manage the details and leave the flags in place.
For command users, the Microsoft page for attrib lists every switch, including options that apply across subfolders. That helps when you want to check for files that lost flags after a copy job.
Practical Wrap-Up
Desktop.ini is part of how Windows paints folders. If it shows, you are viewing system files or the flags fell off. Restore the two view settings and set Hidden and System on the file. Want a custom icon? Keep desktop.ini and let it do the job quietly on your system today.
