Gif Posted June 19, 2007 Share Posted June 19, 2007 is there any way to set the icon of a directory (folder), that you create? Link to comment Share on other sites More sharing options...
evilertoaster Posted June 19, 2007 Share Posted June 19, 2007 (edited) programtically, you make a file called desktop.ini inside the folder in question. Inside the .ini will be somthing like- [.ShellClassInfo] IconFile=%SystemRoot%\system32\SHELL32.dll IconIndex=10 Pretty strightforwad? Edited June 19, 2007 by evilertoaster Link to comment Share on other sites More sharing options...
Gif Posted June 19, 2007 Author Share Posted June 19, 2007 programtically, you make a file called desktop.ini inside the folder in question. Inside the .ini will be somthing like- [.ShellClassInfo] IconFile=%SystemRoot%\system32\SHELL32.dll IconIndex=10 Pretty strightforwad? any better way? without INIs? Link to comment Share on other sites More sharing options...
evilertoaster Posted June 19, 2007 Share Posted June 19, 2007 (edited) It's not like there's a 'way'....windows gets the folder icon information from here and that's all there is to it...when you change it via properties>customize>change icon that's all it does. edit: this is on an xp machine, i dk about other versions of windows Edited June 19, 2007 by evilertoaster Link to comment Share on other sites More sharing options...
Gif Posted June 19, 2007 Author Share Posted June 19, 2007 It's not like there's a 'way'....windows gets the folder icon information from here and that's all there is to it...when you change it via properties>customize>change icon that's all it does.edit: this is on an xp machine, i dk about other versions of windowsok but must desktop.ini necesary be included in the directory?, when i create a directory from properties>customize>change icon as you said i dont see it... Link to comment Share on other sites More sharing options...
dufran3 Posted June 19, 2007 Share Posted June 19, 2007 "show hidden files" Link to comment Share on other sites More sharing options...
Gif Posted June 19, 2007 Author Share Posted June 19, 2007 "show hidden files"pfffffff, try it yourself and see again that there is not desktop.ini.... Link to comment Share on other sites More sharing options...
herewasplato Posted June 19, 2007 Share Posted June 19, 2007 pfffffff, try it yourself and see again that there is not desktop.ini....I see a desktop.ini file created whenever I use:properties > customize > change iconThis is the way the Windows OS has set custom icons since Windows 3.0.Find out what OS setting is preventing you from seeing the file or see how your OS is setup to somehow not make the desktop.ini file.Post back with what you find. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
tAKTelapis Posted June 19, 2007 Share Posted June 19, 2007 (edited) Try it this way Create a folder called "test" on drive C:, and change its icon. then Start> run C:\TEST\desktop.ini It will open, and that IS how windows does it. And it is set as a proected operating system file (tools > folder options > hide protected operating system files) Edited June 19, 2007 by tAKTelapis Link to comment Share on other sites More sharing options...
Gif Posted June 19, 2007 Author Share Posted June 19, 2007 I see a desktop.ini file created whenever I use: properties > customize > change icon This is the way the Windows OS has set custom icons since Windows 3.0. Find out what OS setting is preventing you from seeing the file or see how your OS is setup to somehow not make the desktop.ini file. Post back with what you find. is it the hide protected operating system files setting? i made a search and found many desktop.ini and ok i created a directory and used iniwrite to create the code that evilertoaster said in the same dir, but yet the icon is the same exacly this: [.ShellClassInfo] IconFile=%SystemRoot%\system32\shell32.dll IconIndex=10 what im i doing wrong? Link to comment Share on other sites More sharing options...
herewasplato Posted June 20, 2007 Share Posted June 20, 2007 is it the hide protected operating system files setting?...I'm not sure, I have my OS show all file - including system files. ...what im i doing wrong?...try [.ShellClassInfo] IconFile=%SystemRoot%\system32\SHELL32.dll IconIndex=27 and then add the "s" attrib per this site: http://msdn2.microsoft.com/en-us/library/aa969337.aspx Then close all file explorer windows and reopen one. (refresh view did not always change the icon for me). [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted June 20, 2007 Share Posted June 20, 2007 You probably already know this but just in case..... A tip: Go to your AutoIt directory and then \Examples\GUI\Advanced\ and run enumicons.au3 then you can in a quick and easy way see all icons embedded in shell32.dll or any other file!! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
herewasplato Posted June 20, 2007 Share Posted June 20, 2007 You might need the "h" attribute also. While I was messing around with this, I managed to get my system into a state such that it would chage the icon - even with a system restart - until I added the "h" and "s" attributes... that is Windows for ya. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Gif Posted June 20, 2007 Author Share Posted June 20, 2007 i still cant get it out, i used the attribute +s and i made this [.ShellClassInfo] ConfirmFileOp=0 NoSharing=1 IconFile=%SystemRoot%\system32\shell32.dll IconIndex=10 InfoTip=folder created can you give me some autoit code to do it? im very confused Link to comment Share on other sites More sharing options...
herewasplato Posted June 20, 2007 Share Posted June 20, 2007 (edited) this worked for me:MsgBox(0, "", IniWriteSection("c:\temp\desktop.ini", ".ShellClassInfo", "IconFile=%SystemRoot%\system32\SHELL32.dll" & @LF & "IconIndex=27")) Run(@ComSpec & " /c " & 'attrib c:\temp\desktop.ini +s')The msgbox should have a "1" in it if the IniWriteSection was a success. Edit: but just like before - you play around with this enough and you can get into a state that the icon will not change - unless done manually. Edited June 20, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Gif Posted June 20, 2007 Author Share Posted June 20, 2007 this worked for me:c2--><!--TXNnQm94KDAsICZxdW90OyZxdW90OywgSW5pV3JpdGVTZWN0aW9uKCZxdW90O2M6JiMwOTI7dGVtcCYjMDkyO2Rlc2t0b3AuaW5p JnF1b3Q7LCAmcXVvdDsuU2hlbGxDbGFzc0luZm8mcXVvdDssICZxdW90O0ljb25GaWxlPSVTeXN0ZW1Sb290JSYjMDkyO3N5c3Rl bTMyJiMwOTI7U0hFTEwzMi5kbGwmcXVvdDsgJmFtcDsgQExGICZhbXA7ICZxdW90O0ljb25JbmRleD0yNyZxdW90OykpClJ1bihA Q29tU3BlYyAmYW1wOyAmcXVvdDsgL2MgJnF1b3Q7ICZhbXA7ICYjMzk7YXR0cmliIGM6JiMwOTI7dGVtcCYjMDkyO2Rlc2t0b3Au aW5pICtzJiMzOTsp--><!--egThe msgbox should have a "1" in it if the IniWriteSection was a success. ok managed it! should have used filesetAttrib() Link to comment Share on other sites More sharing options...
herewasplato Posted June 20, 2007 Share Posted June 20, 2007 ok managed it! should have used filesetAttrib()That is funny.One new AutoIt command per script :-)As far as I know, I've never used any of the INI functions before this thread and now you want me to use FileSetAttrib too :-)Thanks for the suggestion... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Gif Posted June 20, 2007 Author Share Posted June 20, 2007 That is funny.One new AutoIt command per script :-)As far as I know, I've never used any of the INI functions before this thread and now you want me to use FileSetAttrib too :-)Thanks for the suggestion...im going to place the script on the exaple scripts forum, im trying to make folder accept icons whist having a tip... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now