Click here to Skip to main content
Click here to Skip to main content
Go to top

Changing the Default Icon of the Folders

, 13 Nov 2001
Rate this:
Please Sign up or sign in to vote.
An article on changing the Default Icons of the Folders

Sample Image - Picture1.jpg

Introduction

Did you ever wanted to change the default icons of the Folders in the windows explorer? May be you want to. And you may tried to find the technique. If you could not found that till now then let me tell you that how can you do that. Look at the image above. The name "Learn and Deploy" do not shows any file, but it is a folder. And similarly, the Programmes is also a folder. Now let's discuss the magic behind this.

To do this, what you have to do is to find an icon which you want to be displayed instead of the original/default folder icon. And then you have to prepare a file named Desktop.ini. Put both files inside the folder which you want to change and there is one step more. But let we discuss first what is the file actually (Desktop.ini)

Desktop.ini is used to save the desktop configurations. But here we will use this file to change the icons of the folders and some attributes of that folder. If you want to write a Desktop.ini, then you can. But your desktop.ini may look like this

[.ShellClassInfo]
ConfirmFileOp=1
NoSharing=1
IconFile=Folder2.ico
IconIndex=0
InfoTip=I hate learning. Let we play, instead....More article text...

OK. Let's discuss this file in detail. The [.ShellClassInfo] is the header of the file and must be present before anything else. The ConfirmFileOp tells that either the folder is a system folder on an ordinary folder. If you equals this to 1, it will be considered as the sytem folder. Windows will popup a message telling that this is a system folder and any change may be dangerous for your system, when you will try to delete or move any file from this folder. NoSharing, name shows that this folder should be shared or not. 1 will not allow to share this folder. and 0 shows doesn't matter if any one share this folder. IconFile is the name of the Icon File which should be replaced by the original icon. IconIndex can be used if you are using icon from an .exe or other file. In that case, you must have to mention the index of the icon. If you are using Stand alone icon file (like with extansion .ico) then this should be 0. InfoTip will display the tip when you will move your cursor on the folder, or when you will select the folder then it will appear on the left pane (when Show as Web Page is true, See above).

That's all. You have created the Desktop.ini file, and you have an icon file. Put them inside the folder. You can hide and make them read only for your safety. But there is no compulsion for this. Now change the attribute of the folder to system. You can do this from the command prompt. Like goto the DOS prompt and then change the folder one step before your folder and then issue the command

Attrib +s <FolderName>

Where <FolderName> is the name of your folder. That's all. Go back to explore your folder. It's icon has been changed.

Just go inside the folder. You should notice onething more. See the picture below.

Notice that at each place, where the folder name appears, your folder's icon is replaced instead of default icon.

This was just the basics of changing the folder icon. You can check more on this topic in the MSDN where they discussed the use of Folder.htt file too to have more changes.

If you think that there is something wrong, then you can contact me at any time. I will be available after 12:00 or before 12:00. I am including the sample with this article. You can check that. Bye upto that time.

Be angry coder with theAngrycodeR

Sameers, SameerS@theangrycoder.com

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Sameers.ME
Web Developer
Pakistan Pakistan
No Biography provided

Comments and Discussions

 
Questionhow windows XP do this?? Pinmember-={sword}=-27-Jun-02 7:33 
Generaldefault icon for C and D drive Pinmembershuklamona15-Nov-01 12:21 
GeneralRe: default icon for C and D drive PinmemberAnonymous3-Mar-02 21:50 
GeneralRe: default icon for C and D drive PinmemberJonny Newman2-Apr-02 7:05 
GeneralRe: default icon for C and D drive Pinmemberlpoi09816-Oct-07 2:33 
GeneralRe: default icon for C and D drive PinmemberMaxzz7-Apr-02 23:22 
GeneralRe: default icon for C and D drive Pinmembersanskypotov31-Mar-03 21:04 
GeneralRe: default icon for C and D drive PinmemberMaxzz13-Apr-03 22:28 
GeneralRe: default icon for C and D drive Pinmembersanskypotov13-Apr-03 22:59 
GeneralRe: default icon for C and D drive Pinmembertomsmaily12323-May-07 17:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 14 Nov 2001
Article Copyright 2001 by Sameers.ME
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid