Customizing Folders with Desktop.ini


Customizing Folders with Desktop.ini

File system folders are commonly displayed with a standard icon and set of properties, which specify, for instance, whether or not the folder is shared. You can customize the appearance and behavior of an individual folder by creating a Desktop.ini file for that folder.

Using Desktop.ini Files

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.

Use the following procedure to customize a folder’s style with Desktop.ini:

  • Use PathMakeSystemFolder to make the folder a system folder. This sets the read-only bit on the folder to indicate that the special behavior reserved for Desktop.ini should be enabled. You can also make a folder a system folder from the command line by using attrib +s FolderName.
  • Create a Desktop.ini file for the folder. You should mark it as hidden and system to ensure that it is hidden from normal users.
  • Make sure the Desktop.ini file that you create is in the Unicode format. This is necessary to store the localized strings that can be displayed to users.

Creating a Desktop.ini File

The Desktop.ini file is a text file that allows you to specify how a file system folder is viewed. The [.ShellClassInfo] section, allows you to customize the folder’s view by assigning values to several entries:

Entry Value
ConfirmFileOp Set this entry to 0 to avoid a “You Are Deleting a System Folder” warning when deleting or moving the folder.
NoSharing Not supported under Windows Vista or later. Set this entry to 1 to prevent the folder from being shared.
IconFile If you want to specify a custom icon for the folder, set this entry to the icon’s file name. The .ico file extension is preferred, but it is also possible to specify .bmp files, or .exe and .dll files that contain icons. If you use a relative path, the icon is available to people who view the folder over the network. You must also set the IconIndex entry.
IconIndex Set this entry to specify the index for a custom icon. If the file assigned to IconFile only contains a single icon, set IconIndex to 0.
InfoTip Set this entry to an informational text string. It is displayed as an infotip when the cursor hovers over the folder. If the user clicks the folder, the information text is displayed in the folder’s information block, below the standard information.

The following illustrations are of the Music folder with a custom Desktop.ini file. The folder now:

  • Has a custom icon.
  • Does not display a “You Are Deleting a System Folder” warning if the folder is moved or deleted.
  • Cannot be shared.
  • Displays informational text when the cursor hovers over the folder.

The folder options in the following illustrations are set to show hidden files so that Desktop.ini is visible. The folder looks like this:

A view of a folder with a custom icon.

When the cursor hovers over the folder, the infotip is displayed.

Web view of a folder with an infotip.

The custom icon replaces the folder icon everywhere the folder name appears.

Custom icon replaces the folder icon.

The following desktop.ini file was used to customize the Music folder, as seen in the preceding illustrations.

[.ShellClassInfo]
ConfirmFileOp=0
NoSharing=1
IconFile=Folder.ico
IconIndex=0
InfoTip=Some sensible information.
About these ads

18 responses to this post.

  1. thank you, guy

    Reply

  2. Posted by MargaretBartley on June 23, 2008 at 5:47 pm

    Very useful. Thanks.

    Reply

  3. This has been useful, thanks.
    I have to ask, how do you have a folder.htt sort of thing in the MyData screenshots even although thisis XP?

    Reply

  4. Posted by Marianne on July 14, 2008 at 8:14 pm

    It won’t work for me. Your steps are very precise…does the folder have to be the C:drive? I want the comments to show when I select the “Details” view…

    Reply

  5. Posted by Dan on August 10, 2008 at 5:11 am

    Is it possible with the desktop.ini to change font color, size, and type for just one folder?

    Reply

  6. Sale kuch nahi janta hai…

    Reply

  7. Suggetion give kar raha hai ki problem

    Reply

  8. Posted by Alex on December 1, 2008 at 12:55 am

    It does not appear to work on windows vista.

    Reply

  9. Posted by Alucard on January 5, 2009 at 10:39 pm

    ow.. very cool man.. thanks.. I have a code for put a wallpaper in folder.
    if u need just add me in msn danilo_lp@rock.com

    Reply

  10. Posted by Paul Brian on January 29, 2009 at 8:59 am

    Hi

    This is a cross post of what is given in MSDN website.
    You are really a very poor blogger!

    Reply

  11. Posted by meisam on July 10, 2009 at 8:19 pm

    thanks this is very usefull, but i want to know how to arrange the folder in desktop.ini

    Reply

  12. How to code the desktop.ini in unicode for folder customization:??
    plz

    Reply

  13. Posted by Anonymous on September 13, 2009 at 8:54 pm

    funny how this how been 100% copied from microsof own webpage.

    http://msdn.microsoft.com/en-us/library/cc144102(VS.85).aspx

    Reply

  14. Posted by Anonymous on October 5, 2009 at 7:12 am

    respect the copyright.

    Reply

  15. Posted by thomas on November 1, 2009 at 2:51 pm

    i need desktop.ini file for folder customization for vista

    Reply

  16. [...] custom default profile More things to check out: How to use desktop.ini to customize folder icons Customizing Folders with Desktop.ini If you want more info on modifying folder picture without scripting, just ask. Reply [...]

    Reply

  17. Posted by plague on November 8, 2010 at 5:47 pm

    plagiarism…

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 191 other followers