Click here to Skip to main content
6,305,776 members and growing! (16,691 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Win32/64 SDK & OS » General     Intermediate

Changing the Default Icon of the Folders

By Sameers (theAngrycodeR)

An article on changing the Default Icons of the Folders
C++Win2K, Visual Studio, Dev
Posted:13 Nov 2001
Views:105,000
Bookmarked:24 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
8 votes for this article.
Popularity: 3.74 Rating: 4.14 out of 5
1 vote, 16.7%
1

2
1 vote, 16.7%
3
2 votes, 33.3%
4
2 votes, 33.3%
5

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Sameers (theAngrycodeR)


Member

Occupation: Web Developer
Location: United States United States

Other popular Win32/64 SDK & OS articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 10 of 10 (Total in Forum: 10) (Refresh)FirstPrevNext
Generalhow windows XP do this?? Pinmember-={sword}=-8:33 27 Jun '02  
Generaldefault icon for C and D drive Pinmembershuklamona13:21 15 Nov '01  
GeneralRe: default icon for C and D drive PinmemberAnonymous22:50 3 Mar '02  
GeneralRe: default icon for C and D drive PinmemberJonny Newman8:05 2 Apr '02  
GeneralRe: default icon for C and D drive Pinmemberlpoi0983:33 16 Oct '07  
GeneralRe: default icon for C and D drive PinmemberMaxzz0:22 8 Apr '02  
GeneralRe: default icon for C and D drive Pinmembersanskypotov22:04 31 Mar '03  
GeneralRe: default icon for C and D drive PinmemberMaxzz23:28 13 Apr '03  
GeneralRe: default icon for C and D drive Pinmembersanskypotov23:59 13 Apr '03  
GeneralRe: default icon for C and D drive Pinmembertomsmaily12318:05 23 May '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 13 Nov 2001
Editor: Chris Maunder
Copyright 2001 by Sameers (theAngrycodeR)
Everything else Copyright © CodeProject, 1999-2009
Web13 | Advertise on the Code Project