Need a script to recursively change folder view properties

Page 4 of 4 FirstFirst ... 234

  1. Posts : 69
    Windows 10 pro, 64 bit
    Thread Starter
       #31

    KeithM said:
    Sorry to hear about your wife. My mom had arthritis in her hips but never opted for replacements -- I remember her discomfort and difficulties well.
    Yes... doubly frustrating because its rapidly getting worse and becoming more painful, but with the current virus situation the hospitals aren't allowing surgery for anything but absolute life threatening emergencies. Stinks because our governor's directives DO allow for surgeries to fix a condition that would result in serious complications if not done, so I'm appealing to the hospital management. But anyway...

    KeithM said:
    OK. That means the one FolderType has a customized view is UserFiles. Which is kind of funny, because it's only used by a single folder, the <FullUserName> folder that is rooted in the Desktop.
    Obviously you understand a great deal more about how this works than I do, as i can't figure out how you connect those dots. But hopefully if I read some of your articles, because this looks like good info to know. Especially because I'm not one to abandon technology I've come to have under my control (Up until this year, most machines in my house were XP-pro, with one win-7 machine for the living-room TV!). So I'll likely stay with Win-10 now until the next Y2K crisis, which I suppose will be when all the 32 bit clocks holding the world together start to become a concern around 2035? I think? LOL!

    Anyway, thanks for the clarification on MERGE.

    KeithM said:
    Thereby hangs a tale! There's a subkey named Inherit that is created in a Bag when the "Also apply this template to all subfolders" is checked on the Customize tab of the Properties dialog. In it's current incarnation, only a single value is created or queried: FolderType. So all it does is ensure a specific FolderType is applied to all subfolders of the folder. So it's pretty much limited to overriding content-sniffing or creating media collections outside of the This PC folders.
    But when XP came out, checking the box set both the inherited FolderType as well as the Icon Mode (which, alas, would suit your purposes). All the other aspects of a view, columns displayed, column width, sort, grouping, etc. were governed by the default view of the associated FolderType. Users then, as you do now, found that limiting. But what I discovered with ProcMon (this is how long I've been playing with folder views!) was that if a folder had an Inherit key, explorer.exe queried the key for the entire set of values found in a "regular"saved view. So, if those values existed, every aspect of the sub-folder views could be controlled, overriding the FolderType defaults. But there was no built-in way to create those values. Apparently, the Shell Development Team had coded the read functionality into explorer.exe, but omitted the write. So I wrote a .vbs script, FolderViewMasterIII that facilitated copying the view settings of a chosen folder to it's Inherit subkey.
    Wow!!! Well the discussion at the top of that page asks the question whether you did one for VISTA, so of course I'll add Win-10. Before I delve into learning how it works and how to apply it, Is there an updated version or does it still work?

    And by the way, this may or may not be significant, but the actual FTP shortcut I created was originally created on my XP pro machine, and the whole (.LNK) file copied over. I don't think it matters because since then I 'scratch' created new shortcuts on my desktop copying only the particular Target credentials...
    ( %SystemRoot%\explorer.exe ftp://<username>:<password>@<server-name-or-IP>/)


    KeithM said:
    A valid concern, esecially with the behavior of Apply to Folders, the approved way to modify a view template. When it creates a custom template, it deletes all previously saved views that use that FolderType.
    That's why I opted for the HKLM\...\AllFolders registry edit. It only affects newly-created views. And though it's far from ideal, if we discover that some FTP folders "share" a FolderType that you otherwise want to default to Icons, a small script could "toggle" the HKLM\...\AllFolders Mode value as your workflow demands.

    Just for clarification, your question muddies the difference between changing a folder's FolderType, eg. from Generic to Pictures, and modifying the default view associated with a FolderType, eg. changing the icon mode for the Pictures FolderType from Icons to Details. Per your example, a new subfolder of your Pictures folder would still use the Pictures FolderType, but the default icon mode would be Details.
    I'm still a little unclear on that, obviously. But bottom line here was the result, mixed in with some relevent side "babbles":

    So I made the REG vile, but started my testing in reverse. I created a new folder on the desktop, dragged in some JPGs, and noted that by default they appeared as icons. (small icons I think). I did the same with my FTP shortcut. Opened it, opened an inner folder and again created a new one, and dragged in some JPGs. Same result (icons). So now I deleted those folders, ran (merged) your REG file, and repeated the test. Now, a new folder created either on my desktop or within the FTP, and dragging in JPGs, made them appear as DETAILS. Great! As an additional test I opened my public "Pictures" Folders and verified that indeed, a new folder created inside one of its inner folders still all inherited the desired "Icon" property/view.

    Of course I'm not sure about other behaviors. From the beginning I chose to create certain common folders like PICTURES in the "Public" area, instead of belonging to ME, the "User", and redirected the OS created "User" "Pictures" location to my "Public" one. So I don't know how a "pictures" folder in my User area will behave.

    Also, I know my test with a "Desktop" folder may be an odd case too, because I've learned that the desktop folder is indeed a special case under win-10. It certainly is the ONLY folder that allows you to place icons anywhere instead of forcing you to select a SORT order. another annoyance I've heard tons of complaints about, seen plenty of so-called" solutions, none of which work!. Don't suppose you have any thoughts on that?

    KeithM said:
    Yes to testing a new folder. But your mention of JPGs raises an interesting point. If the FTP folder views are subject to content-sniffing, JPGs would most likely trigger the use of the Pictures FolderType. So repeat the test by creating another new folder & dropping some TXT files into it before viewing. Maybe even a third test with .reg or .dll to ensure a Generic FolderType, as the TXT files might set the folder to the Documents FolderType.

    Again: Do the FTP folders have a Customize tab in their Properties dialog??? That would answer these questions quickly! You're welcome!
    No they don't! Of course the shortcut itself has no properties like that, and if I open the FTP and look at Properties for any folder at the FTP site, all they have is a "General" tab, with the read/write/modify boxes.

    Thanks again for all the detail! I'll look forward to your continued insights, and reading further into the links you've offered.!
      My Computer


  2. Posts : 989
    Microsoft Windows 10 Home
       #32

    PeterPan2000 said:
    Obviously you understand a great deal more about how this works than I do, as i can't figure out how you connect those dots.
    The GUID value names under HKCU\...\Streams\Defaults ( created by ​Apply to Folders )reference the FolderTypes found under:
    Code:
     HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes
    In my post that I linked to earler, there's PowerShell code you can run to view a complete list of FolderTypes. Knowing which folder they apply to is sometimes obvious, sometimes not so much. It was a while before I realized that the various StorageProvider types were used by OneDrive folders.


    Anyway, thanks for the clarification on MERGE.
    You're welcome!




    Wow!!! Well the discussion at the top of that page asks the question whether you did one for VISTA, so of course I'll add Win-10. Before I delve into learning how it works and how to apply it, Is there an updated version or does it still work?
    No, sorry, no updated version. I was exploiting buit-in capability that has since been removed.



    And by the way, this may or may not be significant, but the actual FTP shortcut I created was originally created on my XP pro machine, and the whole (.LNK) file copied over. I don't think it matters
    If it ain't broke, don't fix it!



    So I made the REG vile, but started my testing in reverse. I created a new folder on the desktop, dragged in some JPGs, and noted that by default they appeared as icons. (small icons I think). I did the same with my FTP shortcut. Opened it, opened an inner folder and again created a new one, and dragged in some JPGs. Same result (icons). So now I deleted those folders, ran (merged) your REG file, and repeated the test. Now, a new folder created either on my desktop or within the FTP, and dragging in JPGs, made them appear as DETAILS. Great! As an additional test I opened my public "Pictures" Folders and verified that indeed, a new folder created inside one of its inner folders still all inherited the desired "Icon" property/view.
    Excellent! We have our desired behavior, right?



    Of course I'm not sure about other behaviors. From the beginning I chose to create certain common folders like PICTURES in the "Public" area, instead of belonging to ME, the "User", and redirected the OS created "User" "Pictures" location to my "Public" one. So I don't know how a "pictures" folder in my User area will behave.
    Most likely like any other folder: subject to content-sniffing or user choice via Customize tab.



    Also, I know my test with a "Desktop" folder may be an odd case too, because I've learned that the desktop folder is indeed a special case under win-10. It certainly is the ONLY folder that allows you to place icons anywhere instead of forcing you to select a SORT order. another annoyance I've heard tons of complaints about, seen plenty of so-called" solutions, none of which work!. Don't suppose you have any thoughts on that?
    No, sorry. Like the Inherit behavior that existed in XP, the code that supported this behavior has been removed.



    No they don't! Of course the shortcut itself has no properties like that, and if I open the FTP and look at Properties for any folder at the FTP site, all they have is a "General" tab, with the read/write/modify boxes.
    That's a relief! I would hate for there to be an easy way after all this!


    Thanks again for all the detail! I'll look forward to your continued insights, and reading further into the links you've offered.!
    You're welcome. Post back for any desired clarification.

      My Computer


  3. Posts : 69
    Windows 10 pro, 64 bit
    Thread Starter
       #33

    KeithM said:
    You're welcome. Post back for any desired clarification.

    My only request, if you have time, is that if possible, a VBS script to do what your were ultimately able to do would still be welcome. As I understand it, with the aid of the process monitor logs of my operations / interactions with the unknown FTP shortcut, you were able to build a registry patch that (a) linked the "bags" entry explorer.exe was using for the shortcut, to a specific folder template or behavior , and (b) added an inheritance property, so that new folders (or as yet unopened folders) would have the same behavior.

    Maybe I have a few details wrong, but I think that's the gist. And I suspect that making those registry changes programmatically would be possible using VBS. If that is the case, and IF process explorer is able to see what "bags" entry was linked to the shortcut, should there be a way of doing both the discovery and the registry patch in a reusable script? That way, anyone could pass any shortcut to anything explorer.exe could connect with, and choose a desired template behavior from a menu, and "presto"!

    Now I'm not being lazy in asking for such a script, but I will point out that it will take me a lot of digging just to THINK I understand what you were able to do, and even then I suspect I'd be very nervous about making the registry change myself. So considering that the request I made might be a common one (even if its not often for an FTP shortcut), would it be worthwhile to create such a general purpose VBS script?
      My Computer


  4. Posts : 989
    Microsoft Windows 10 Home
       #34

    It's late, about to go to bed, but a few brief points:
    • I've forgotton all the VBS I ever knew --- haven't used it since XP. PowerShell is the modern scripting language for Windows.
    • I'm not sure a script would be useful in this situation (if I understand you correctly)
    • We never made use of an Inherit key (which affects the FolderType, not the Icon mode)


    What we did do was create the registry entries with a .reg file. I think the thing to do might be comment the .reg file to associate human-readable names with the GUIDs.

    Here's an example of script registry creation vs. .reg file: How do you default the Windows 10 Explorer view to `Details` when looking at search results? - Super User
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:35.
Find Us




Windows 10 Forums