IconViewer

Discussion in 'Interesting/Unrelated' started by bphlpt, Mar 6, 2021.

  1. bphlpt

    bphlpt A lowly staff member Staff Member

    I'm sure this is very old news to some of you here, but then I'm very old. :)

    This will be a somewhat convoluted explanation, but here goes. I recently installed a Win7 Pro release. It installed the way it should, and doing a fresh install fixed some nagging driver issues I'd been having, but I'd been too lazy to fix. When I installed, I used Freezer's SetupS option to move several profile folders to "D:\", and the results weren't quite as complete or clean as I wanted. ( I'll post my results in another post when I complete them.) I wanted to have the new locations have all of the same folder icons as all of the original locations, have ONLY the new locations shown in the Explorer navigation pane, etc, and I figured I'd use the "traditional" built in icon sources such as shell32.dll and imageres.dll. [ I found a good reference - Windows 10 icons. Where are they located? In which files and folders? - which seems applicable to Win7 as well, which listed several other system files which also have handy icons available.] I'm sure that Trouba is shaking his head and saying, "Why didn't you just use ______ssApp.apz? It's been in the repo for years and works great?" Well, with my advancing years the memory seems to go for anything I don't use often, so I end up re-inventing the wheel more often than I'd like.

    I thought I'd use code something like this to set the folder icon:

    Code:
    ...
             mkdir %folder%
             echo(>%folder%\desktop.ini
             echo([.ShellClassInfo]>>%folder%\desktop.ini
             echo(IconResource=%%SystemRoot%%\system32\%icon_source_file%,-%icon_number%>>%folder%\desktop.ini
             attrib %folder%\desktop.ini +S +H
             attrib %folder% +S /S /D
    ...
    
    where %icon_source_file% is imageres.dll or whatever, and %icon_number% is the number of the icon. DUH :)
    
    That works great, but you need the right icon number. References such as this one - Windows 7 imageres.dll Icons & ID Chart with Correct ID Numbers - were a start, but regardless of the page title, the numbers they list are NOT the right icon numbers necessary for IconResource. They might be for DisplayIcon, but I couldn't get that to work for my purposes. I wrote a quick and dirty loop to increment through all possible icon numbers and assign icons to correspondingly numbered folders so I could visually scan through for the valid icon numbers, but I also just as quickly found out that the icons were often not consecutive, sometimes with numbers 10's of thousand apart. Going through that loop, creating the folders, and assigning the icons completely bogged down my system, even with 32G of memory and two SSD's. I could do other things fine, but it didn't speed up the loop. Some %icon_source_file% searches took HOURS. There had to be a better way.

    Then I found a neat little system file extension we didn't have an app made for, or at least I couldn't find it. IconViewer, v3.02.147.0, made by BotProductions (suspicious name, I know) back in 2008. Their site doesn't mention any OS more recent than Vista, and they have versions of the program available for old OS such as NT 4.0 and Win 95, so maybe that's why it slipped through the crack. They do have both 32 and 64 bit versions of the program, and I've seen mention of it elsewhere, such as Major Geeks, that say it works for OS as new as Win10. The program is quite complete, easy to use, and includes a useful help file. [ Help files sometimes aren't. LOL ] When in use it looks something like this -

    [​IMG]

    In newer OS than XP it looks a little nicer, consistent with the looks of the other file extensions of your OS.

    It shows all of the icons available, with their CORRECT icon number, including if they are available in different resolutions, then allows you to select an icon and resolution, and either copy it to your favorite image viewer/editor, or save the icon as an .ICO file. It can even optionally operate over multiple files at once - select multiple files, right click, select properties/Icons. All of the icons from all files selected will be shown with multiple options as to how and in what order they are listed, though you can only select one icon at a time to copy or save. Altogether, a very useful little utility.

    This helped me out, and I hope it helps someone else as well.
     
    00Proteus00 and The Freezer like this.
  2. Trouba

    Trouba Administrator Staff Member

    I had run across this issue as well but didn't come up with as good a solution as yours, so thanks :)
     
    00Proteus00 likes this.
  3. The Freezer

    The Freezer Just this guy, you know Staff Member

    I'd be curious to see those results myself. :)

    Though I'm not sure if I can take the credit for the SetupS option that moves profile folders. I believe that it's Glenn that has a tool/reg-tweak that can do that -- usually included with a LastOS release ;)

    SetupS assigns/moves only the ppApps or ppGames drive letter via either the ssControlPanel or Glenn's LastOS Settings tool, like so:

    upload_2021-3-8_14-38-20.png

    upload_2021-3-8_14-24-51.png

     
    00Proteus00 likes this.
  4. bphlpt

    bphlpt A lowly staff member Staff Member

    I was referring to the option to "Set Documents to drive: ... " checkbox shown in your second picture above, which I now see is actually part of Glenn's LastOS Settings tool. Since that tool has been invoked every time I have ever done a SetupS install, I had forgotten that it is actually a separate tool. :) Do we know exactly what all that option does?

    I like the idea of moving my Documents and other profile folders to a different drive, and had implemented something like that on my own back in 2010 when I first started playing with Win 7 and was first introduced to LastOS. I'm in the process of digging through my old notes, combining my old code with that of others to come up with something that works for me. I'll share when I get it to work or get stuck. [ I'm in the process of doing some major home renovation and repair, so I'm not spending that much time on computer efforts at the moment. ]
     
    00Proteus00 and The Freezer like this.
  5. The Freezer

    The Freezer Just this guy, you know Staff Member

    I'd like to know myself. There's a whole slew of those profile folders (aka, "special folders") that can be moved off the system drive (C:\), each having their own folder icon-picture: Contacts, Desktop, Documents, Downloads, Favorites, Links, Music, Pictures, Saved Games, Videos. Many such as Favorites are obsolete or useless now.

    For me, the primary ones I always move are Desktop, Documents, Downloads, Music, Pictures, & Videos.

    Pre-Vista, several of those were sub-folders of Documents: Music, Pictures, and Videos. So perhaps that's what's really going on with Glenn's tool moving only the Documents folder (still using the old paths?).

    Regardless, I end up having to move them manually like so:

    upload_2021-3-10_9-21-35.png
     
    00Proteus00 likes this.
  6. Glenn

    Glenn Administrator Staff Member

    It creates a X:\Documents folder and moves many of the folders across to it, the 2 cravats are that if it's a fresh installation and partitioned HDD you will have to apply the settings app twice as it is a glitch in Windows where creating the folder and then setting it as a location in the registry it doesn't stick straight away and can take user interaction with mouse or touch to make it bloody work, I tried for a while to get it to work but gave up and just apply my settings twice, this isn't an issue on systems that have had the Documents folder made on the drive from a previous install. The 2nd is the fact this trick doesn't work with the Downloads folder, this one needs to manually be set as Freezer does his, this is a security feature of Windows as Defender the registry and many others protect that folder from being hijacked and will not let you change it pragmatically without issues arising (This and my screen color management are the only two manual steps I do after I install my PC).

    The reason you would want to move your documents off the OS Disk are obvious (especially if you like to install fresh OS's all the time and do not want to have to keep backing them up.

    I hope this help you understand what that feature is now.

    Example.png

    As you can see, I use this feature myself and I have never had any issue with it, I feel so much safer knowing my Desktop and documents are safe on my other HDD during a fresh OS install
     
    00Proteus00 and The Freezer like this.
  7. The Freezer

    The Freezer Just this guy, you know Staff Member

    I think I see now. So it sets/moves other "special folders" (except "Downloads"). I was never sure if it only moved "Documents" and had never tried it. Do you have a list of what all folders it moves off the System-OS Drive, such as "Desktop" and/or all the ones listed under "Libraries"?
     
    00Proteus00 likes this.
  8. Trouba

    Trouba Administrator Staff Member

    Relocation of these folders had never been clear to me either, so my approach had been to just avoid these user folders and use those I created for categories relevant to me on secondary drives. But this is good information and may be useful when installing an OS for others.
     
    00Proteus00 likes this.
  9. vanTorX

    vanTorX Member

    Since I have just reinstalled windows, I will share one gotch'ya

    Installing on 2TB drive, I deleted all old partition on it during install start because I pulled the drive from an older PC and the disk was MBR and I needed GPT system on it. As usual I made 155 000 MB partition and the rest of the disk space into another one. BTW that '155' makes it show up as even 150GB in properties windows.

    After the installation I used that LastOS Setting panel to move Documents to D: drive a completely forgot that the D: was my USB install disk because a) I forgot to format that second partition before the install start, so it didn't even show up and b) even if I did format it, the installation USB key usually takes the D: letter and gives the second partition on the HDD 0 some other letter.

    Either it moved Documents to USB key or found it couldn't do that, the PC froze and there was nothing doing but re-do the win installation all over again from the start.
    Even when you format the second partition, it doesn't get D letter anyway because of the USB install key, need to remove that key and assign the letter manually in win Computer disk management.

    After this second install, I used that Settings panel to move the Documents (and ppAppz) to D: drive (which I like to name 'Data-D'). I am eternally grateful for that feature in the Settings panel, knowing the intricacies that can arise trying to do that moving manually as windows provides the means...
    upload_2021-5-9_13-6-48.png

    Next I wanted to move the Downloads folder. On previous installation I had it inside the Documents and I forgot how I moved it there. I used the folder property panel that Freezer showed above here, moving it to Documents but if I recall it right, it either didn't want to move there or it said it moved but I couldn't see any Downloads folder made in there. So I made one and tried to move it in there but was told 'you can't move the folder into its parent folder' or something to that effect.

    So I moved it to D: and it did but again, no Downloads folder was made in D:, clearly it would be spilling files into the D: root, and after I made folder 'Downloads' in there, it again refused to 'move to its parent folder'.

    Well, I gave up and moved the Downloads back to its default location and after some mulling it over, how I did that before, I recalled I simply made a Downloads-D folder in Documents and pinned it to Quick Access in Explorer and directed all future downloads to that place manually. That method works quite well, only some exceptions use that default location, I think downloading in IE may sends files directly to the native Downloads on C: without giving you a choice.

    Somehow on my old drive, I had that fat blue arrow icon on that Downloads folder, not sure how it got there, I surely didn't play with icons like bphlpt did.

    Moving Documents manually and especially the Downloads folder can lead to a nightmare situation when you don't know anymore what you are doing and when I got to the point where the Documents folder refused to return to Default location (I guess moving it several times and knowing less each time what I was doing, it broke), it was a big mess :eek:

    I remember also once before having to reinstall the whole windows all over again after such situation I got into. As Glenn says, Downloads folder is some special folder. I suppose after moving it to D:, it would probably put that fat blue arrow icon on the D: drive and spill files into its root, same if I moved it to 'Documents'. But it seems you can't make Downloads folder manually and direct to move the official Downloads location in there.

    BTW I never used Favorites and Contacts, only the Desktop and MyDocuments
    Also learned hard way not to use names like MyDocuments anywhere since windows has some special lock on that name and probably some other ones too. Best is to modify those names when you copy files out from some computer to a backup location or it gets you in trouble later on when you try to move the stuff back onto reinstalled computer.
     
    Last edited: May 22, 2021
    Glenn and The Freezer like this.
  10. Glenn

    Glenn Administrator Staff Member

    I have come across all those sorts of issues, I now make sure the drives are correct before I use settings to adjust them. I've not had downloads fail like that for me before but I have had to use a reg key to manually fix it before. There isn't an easy way to protect against drive changes, so I'd have to do a disk type test as you press Apply in settings to ask if you really want to apply it to a USB disk.. might be worth an update :)
     
    The Freezer likes this.
  11. vanTorX

    vanTorX Member

    I don't think you should bother, I saw it as my fault, dumb thing to forget to check first that you have the D disk and that its not the install disk.

    But if that moving of Documents could be made to include moving Downloads folder as well (or a separate option for that), that would be welcomed but really not necessary if that's too much of a bother.
     

Share This Page