patgenn123 Posted June 11, 2008 Share Posted June 11, 2008 (edited) Hello! Real noob here... I am trying to start from the ground up and learn this program. Really ignorant on Autoit. I looked around in Search under "icon". Looked at all 34 pages and couldn't see it(maybe just me). Should be simple to answer: How can I change a folder icon to "a specific icon" of my choosing using an autoit script? Any help would be great! Please try not to write it for me unless I beg. I really want to learn this. Clues, links etc would be great! Thanks! -P Edited June 11, 2008 by patgenn123 Link to comment Share on other sites More sharing options...
patgenn123 Posted June 16, 2008 Author Share Posted June 16, 2008 Hey everyone! This topic was started on May 11th and is now page 14! Wow does this board move fast!!!! I was still wondering if anyone knew of how to do this. I'm thinking this would be pretty easy for a sorry backward scripting AUTOIT newbie like me, but.... I know nothing! Trying to learn. Asking for clues, but not the whole script please. Please point me with SOME clues! Pat Link to comment Share on other sites More sharing options...
TehWhale Posted June 16, 2008 Share Posted June 16, 2008 I'm thinking your best bet right now is the Registry. I will look into a key for this! Great timing on bumping your thread! Link to comment Share on other sites More sharing options...
patgenn123 Posted June 18, 2008 Author Share Posted June 18, 2008 Hello Jason, Hello All, What I am trying to do is change a folder's icon based on a word copied into a clipboard. I'll give everyone an example. If the clipboard contains the word "processing", create a folder icon that has a chosen icon that would help a person identify that this folder is for "processing". If the clipboard has some other word, give it a different icon. Within the script, have the script revert back to the normal yellow folder after the icon has been created and "viola" done! I know I have been looking around Google for this and there is some ideas around there, but how would this work with AutoIT because I am new to this. Thanks! Pat Link to comment Share on other sites More sharing options...
TehWhale Posted June 18, 2008 Share Posted June 18, 2008 Truthfully I cannot find the registry key for changing a specific folder. Although I wish others would try to help considering your very descriptive and asking extremely nicely, with tons of patience. Link to comment Share on other sites More sharing options...
rasim Posted June 18, 2008 Share Posted June 18, 2008 patgenn123Quick example:$folder = FileSelectFolder("Choose folder...", "", 0, @MyDocumentsDir) If @error Then Exit $ico = FileOpenDialog("Select a file...", @MyDocumentsDir, "Icon contains files (*.ico;*.exe;*.dll)", 1) If @error Then Exit IniWriteSection($folder & "\" & "Desktop.ini", ".ShellClassInfo", _ "IconFile=" & $ico & @LF & _ "IconIndex=0" & @LF & _ "InfoTip=AutoIt RULEZZZ!") If FileSetAttrib($folder & "\" & "Desktop.ini", "+H") = 1 Then MsgBox(64, "Set Folder Icon", "Success!") Link to comment Share on other sites More sharing options...
cyanidemonkey Posted August 27, 2008 Share Posted August 27, 2008 (edited) patgenn123 Quick example: $folder = FileSelectFolder("Choose folder...", "", 0, @MyDocumentsDir) If @error Then Exit $ico = FileOpenDialog("Select a file...", @MyDocumentsDir, "Icon contains files (*.ico;*.exe;*.dll)", 1) If @error Then Exit IniWriteSection($folder & "\" & "Desktop.ini", ".ShellClassInfo", _ "IconFile=" & $ico & @LF & _ "IconIndex=0" & @LF & _ "InfoTip=AutoIt RULEZZZ!") If FileSetAttrib($folder & "\" & "Desktop.ini", "+H") = 1 Then MsgBox(64, "Set Folder Icon", "Success!") i have tried this code, but it does not seem to work (WinXP). i understand what it does, and if i manually change a folder icon via rightclick>properties it writes the same Desktop.ini with the same contents and it works/refreshes the folder icon. could it be something to do with this issue described here: http://www.pcmag.com/article2/0,1895,1558896,00.asp and can the sample code in the artical be converted to autoit3? EDIT: i changed the above a little and now it seems to update the folder icon streight away. (i'm guessing the change file attributes on the folder is forcing explorer to update/refresh it's icon?) $folder = FileSelectFolder("Choose folder...", "", 0, @MyDocumentsDir) If @error Then Exit $ico = FileOpenDialog("Select a file...", @MyDocumentsDir, "Icon contains files (*.ico;*.exe;*.dll)", 1) If @error Then Exit IniWriteSection($folder & "\" & "Desktop.ini", ".ShellClassInfo", _ "IconFile=" & $ico & @LF & _ "IconIndex=0" & @LF & _ "InfoTip=AutoIt RULEZZZ!") FileSetAttrib($folder, "+R") If FileSetAttrib($folder & "\" & "Desktop.ini", "+HSA") = 1 Then MsgBox(64, "Set Folder Icon", "Success!") also, will these registry keys mentioned here do the same thing in autoit: http://resource.dopus.com/viewtopic.php?p=...509cb6989e9880e Edited August 27, 2008 by cyanidemonkey My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator Link to comment Share on other sites More sharing options...
rasim Posted August 27, 2008 Share Posted August 27, 2008 (edited) cyanidemonkeyHmm... but above code works fine for me, try this:$folder = FileSelectFolder("Choose folder...", "") If @error Then Exit $ico = FileOpenDialog("Select a file...", "", "Icon contains files (*.ico;*.exe;*.dll)", 1) If @error Then Exit IniWriteSection($folder & "\" & "Desktop.ini", ".ShellClassInfo", _ "IconFile=" & $ico & @LF & _ "IconIndex=0" & @LF & _ "InfoTip=AutoIt RULEZZZ!") FileSetAttrib($folder & "\" & "Desktop.ini", "+H") FileSetAttrib($folder, "+R")Edit: This should be work. Edited August 27, 2008 by rasim Synapsee 1 Link to comment Share on other sites More sharing options...
zFrank Posted August 27, 2008 Share Posted August 27, 2008 @ cyanidemonkey your code works fine because Desktop.ini needs +SHR attribs to work. Synapsee 1 [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
cyanidemonkey Posted September 2, 2008 Share Posted September 2, 2008 the above works for XP, but not on Vista, we have machines that use both, so what parts of the desktop.ini file do i mod to make it work on both systems? at the moment i am changing the desktop.ini as follows: XP Desktop.ini: [.ShellClassInfo] IconFile=S:\Client Projects\Framework Latest\default_files\ico\flash.ico IconIndex=0 InfoTip=AutoIt RULEZZZ! Vista desktop.ini: [.ShellClassInfo] LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21790 InfoTip=@%SystemRoot%\system32\shell32.dll,-12689 IconResource=%SystemRoot%\system32\imageres.dll,-108 IconFile=%SystemRoot%\system32\shell32.dll IconIndex=-237 My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator Link to comment Share on other sites More sharing options...
cyanidemonkey Posted September 3, 2008 Share Posted September 3, 2008 (edited) Found here: http://www.eggheadcafe.com/software/aspnet...ta-does-no.aspxI've confirmed with shell team that the API SHGetSetFolderCustomSettingswill let explorer know that the desktop.ini has been updated.is there a way autoit script call 'SHGetSetFolderCustomSettings' to force windows explorer to refresh in vista? i've been changing the Desktop.ini file line:LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21790toLocalizedResourceName=S:\Client Projects\Framework Latest\default_files\ico\flash.ico,0but the ico won't show on vista. Edited September 3, 2008 by cyanidemonkey My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator 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