Thanks in advance.
Just to clarify, I don't want to create a shortcut but rather when I create a folder in the Documents and Settings\All Users\Desktop folder, I'd like to be able to choose an icon to go with that folder if they're using XP.
Professional Software Development Tools
Thanks in advance.
Just to clarify, I don't want to create a shortcut but rather when I create a folder in the Documents and Settings\All Users\Desktop folder, I'd like to be able to choose an icon to go with that folder if they're using XP.
Last edited by Nocturnal; 06-03-2006 at 07:32 PM.
No i dont think changing the icon is possible, atleast not by only using ams am afraid.
Iam not sure if you could use some regkey to do it.maby
Ok using the Zip.Extract function and having it extract a .zip file which includes a folder along with a desktop.ini file in it, I am thinking this should work but this is not the case. Any ideas as to why this isn't happening? Shouldn't the desktop.ini automatically be picked up as far as the icon settings go by Windows?
Don't forget to pass the attrib +s argument. As that sets the folder's attribute to System (which is needed in order to have the .ico file swapped out to what you want).
To test this:
Copy the folder with your .ico and .ini file to the Desktop (if it's not there already). Then click START>RUN>(type) attrib +s "ExactPathToFolder-IncludeTheseDoubleQuotes!">click the ENTER key.
Intrigued
How would you go about adding that attrib using AMS?Originally Posted by Intrigued
Ok this is what I have so far:
So initially I have a button in which if clicked on, it will unzip this particular folder which already includes a desktop.ini and the icon file. Then, I am trying to set the attrib of the folder to System so that my icon will show up. Am I missing something? I get an error with line four when I try to preview the program.Code:Zip.Extract("AutoPlay\\Docs\\sg.zip", {"*.*"}, _DesktopFolderCommon, true, true, "", 3, nil); -- get the file's current attributes attrib = File.GetAttributes( _DesktopCommonFolder .. "\\Folder1" ); -- override a couple of values in the table attrib.System = true; -- set the modified attributes back to the file File.SetAttributes( _DesktopCommonFolder .. "\\Folder1", attrib );
So what I'm trying to work with now is after having it unzip the files to the desktop, having it also run a batch file which gives the folder attrib +s. But I'm having one **** of a hard time doing this. Any help is appreciated.
To customize a folder, there is a special file 'desktop.ini' within it which holds the custiomization data, including custom icon.
For example, desktop.ini file could contain:
This would make it have an icon just like a hard drive.Code:[.ShellClassInfo] IconFile=%SystemRoot%\system32\SHELL32.dll IconIndex=8
Last edited by bule; 06-04-2006 at 03:25 AM.
Never know what life is gonna throw at you.
(Based on a true story.)
yes this is easy
you just need to create a file named desktop.ini inside the folder you wanna mask
and put
Code:[.ShellClassInfo] IconFile=c:\icon.ico <== this is the path to the icon IconIndex=1 <== this is the icon index (if it's a collection)
I've been playing with this before, and I can get the custom icon set to my folder on the Start Menu, but how can I hide the desktop.ini file without hiding the folder? If I try and hide the desktop.ini file inside the folder, it hides the folder.
Well what I did was have a zip file that included the folder. Use the Zip.Extract function to unzip the folder and place the contents into the %ALLUSERPROFILES%\Desktop directory. Inside of the zipped up file was a folder and also the desktop.ini file as well as the .ico file. I also told it to hide the .ico file afterwards. I'm not sure about placing it on the start menu and what not but this is definately a start in the right direction.
Well you set the file attributes as system hide, no just hide.Originally Posted by Tek
For more info on desktop.ini go-->
http://msdn.microsoft.com/library/de...ing/custom.asp
Did you try it like this:Originally Posted by Tek
Code:File.SetAttributes(folder.."\\desktop.ini", {System=true, Hidden=True});
Never know what life is gonna throw at you.
(Based on a true story.)
Ahh that's working now. Thanks everyone, and bule.![]()