Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 14 of 14
  1. #1
    Join Date
    Jun 2006
    Posts
    29

    Folder.Create -- is it possible to some how create a folder with a specific icon?

    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.

  2. #2
    Join Date
    Apr 2005
    Location
    In Wonderworld
    Posts
    246
    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

  3. #3
    Join Date
    Jun 2006
    Posts
    29
    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?

  4. #4
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    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

  5. #5
    Join Date
    Jun 2006
    Posts
    29
    Quote Originally Posted by Intrigued
    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.
    How would you go about adding that attrib using AMS?

  6. #6
    Join Date
    Jun 2006
    Posts
    29
    Ok this is what I have so far:

    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 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.

  7. #7
    Join Date
    Jun 2006
    Posts
    29
    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.

  8. #8
    Join Date
    May 2005
    Posts
    1,115
    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:

    Code:
    [.ShellClassInfo]
    IconFile=%SystemRoot%\system32\SHELL32.dll
    IconIndex=8
    This would make it have an icon just like a hard drive.
    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.)

  9. #9
    Join Date
    Mar 2005
    Posts
    222
    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)

  10. #10
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    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.

  11. #11
    Join Date
    Jun 2006
    Posts
    29
    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.

  12. #12
    Join Date
    Mar 2005
    Posts
    222
    Quote Originally Posted by Tek
    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 you set the file attributes as system hide, no just hide.

    For more info on desktop.ini go-->
    http://msdn.microsoft.com/library/de...ing/custom.asp

  13. #13
    Join Date
    May 2005
    Posts
    1,115
    Quote Originally Posted by Tek
    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.
    Did you try it like this:

    Code:
    File.SetAttributes(folder.."\\desktop.ini", {System=true, Hidden=True});
    Never know what life is gonna throw at you.
    (Based on a true story.)

  14. #14
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Ahh that's working now. Thanks everyone, and bule.

Similar Threads

  1. cookies
    By goukilord10 in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 05-20-2005, 04:08 PM
  2. Install specific file to specific folder.....?
    By BigBoss in forum Setup Factory 6.0
    Replies: 1
    Last Post: 08-18-2003, 07:27 AM
  3. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  4. HOWTO: Create a Page Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-26-2002, 05:20 AM
  5. HOWTO: Create an Empty Folder
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-21-2002, 03:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts