softwaredevelop
8th October 2005 12:10 UTC
changing the default icon for a directory
I am trying to create a directory and use a different icon for the folder - is this possible?
This is the code for creating the directory - what would be the next step?
CreateDirectory "$Desktop\Primary Applications"
kichik
8th October 2005 14:22 UTC
If you create a file named Desktop.ini in the folder, you can put this in it to change the icon:
[.ShellClassInfo]
IconFile=%SystemRoot%\system32\SHELL32.dll
IconIndex=12
You can use WriteINIStr to write INI files. Note that this feature was not available on all Windows versions.
Anders
8th October 2005 17:00 UTC
it works on 98 and up (should work on 95+ie4 shellupdate)
just remember to make the desktop.ini file hidden+system+read-only
and the folder should be read-only+system
Comm@nder21
8th October 2005 18:00 UTC
this macro prepares any given folder to apply desktop.ini
i used it with success.
!define PathMakeSystemFolder "!insertmacro PATH_MAKE_SYSTEM_FOLDER"
!macro PATH_MAKE_SYSTEM_FOLDER pszPath
System::Call "shlwapi::PathMakeSystemFolder(t '${pszPath}') i."
!macroend
call it that way:
${PathMakeSystemFolder} "C:\MyFolder"