What are the desktop.ini files for?

13

3

My desktop has two hidden .ini files:

desktop.ini (370 bytes):

[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21799
[LocalizedFileNames]
Microsoft Office - 60 Day Trial.lnk=@C:\PROGRA~1\MICROS~4\mui\oaa.dll,-103

and under the same name,

desktop.ini (456 bytes):

[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769
IconResource=%SystemRoot%\system32\imageres.dll,-183
[LocalizedFileNames]
Windows Media Player.lnk=@%SystemRoot%\system32\unregmp2.exe,-4

Is it safe to simply delete them? (They don't look like they are doing anything (and I like to have the display setting "show all hidden files" enabled, so it's appearing on my desktop, yikes).)

BTW, why is it possible that two files have the same name?

Pacerier

Posted 2011-07-06T11:34:48.357

Reputation: 22 232

Answers

12

As you make customizations to a system folder, the system will auto-generate a desktop.ini file in that folder to store the settings. A good resource for this is here. While you can delete the file, Windows will likely automatically re-create the file over time.

You are likely seeing two desktop.ini files because the Desktop is comprised of two folder locations. Your user's Desktop folder and the All Users/Public Desktop folder. There is likely a desktop.ini file for each of these folders. One is likely stored in .\users\some_username\desktop and the other is in .\users\public\desktop. It's impossible to have two files with the exactly same file name in the same folder.

In Windows 7, you can select 'Show hidden files, folders and drives' but keep checked 'Hide protected operating system files (Recommended)' to keep the desktop.ini and a few other items hidden from view.

edusysadmin

Posted 2011-07-06T11:34:48.357

Reputation: 2 158

1Here's a more exhaustive resource on desktop.ini entries – Tobias Kienzler – 2014-09-24T11:51:04.310

2

http://msdn.microsoft.com/en-us/library/cc144102%28v=vs.85%29.aspx

Folders are normally displayed with the standard folder icon. A common use of the Desktop.ini file is to assign a custom icon or thumbnail image to a folder. You can also use Desktop.ini to create an infotip that displays information about the folder and controls some aspects of the folder's behavior, such as specifying localized names for the folder or items in the folder.

You probably have one in your desktop and one in the desktop for "All Users", thats why you see two files with the same name.

cularis

Posted 2011-07-06T11:34:48.357

Reputation: 1 169

4Why is it called "Desktop.ini" when "Folder.ini" would make much more sense, considering it's not limited to the desktop? – JAB – 2011-07-06T14:39:13.190

1

Desktop.ini stores information about personalised folders, so if you have changed the look of your desktop in some way that is stored in desktop.ini. If you delete the file you may have to re-personalise your folders, desktop etc.

slotishtype

Posted 2011-07-06T11:34:48.357

Reputation: 2 875

is there anyway to explicitly hide these files from my desktop ? (without having me to set a global "hide all hidden files") – Pacerier – 2011-07-06T11:45:13.887

To hide the .ini files, check "Hide protected operating system files (Recommended)" in your folder view options. – slotishtype – 2011-07-06T12:39:09.410