Need a script to recursively change folder view properties

Page 1 of 4 123 ... LastLast

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

    Need a script to recursively change folder view properties


    I have created a file explorer shortcut, which connects to a remote web server via FTP and opens a convenient folder view window. It is a convenience for me when updating a few files, because I can easilly navigate around, dragging and dropping files in and out. The problem is, the folder displays an ICON view. If I switch to what i want (Details view) it is remembered even after closing the connection or even re-booting. BUT... when i look at sub folders, they are all still in the ICON view. I can manually change every sub folder, and every subfolder beyond and again my choices are remembered. But if you consider that a folder for web site data has hundreds of nested folders, it should be apparent that opening each one manually to select the view is inconvenient.

    Now I don't want to use the usual method of making ALL folders EVERYWHERE in the system have the same view. I also notice that in my FTP explorer view, I can't even do the usual procedure of selecting VIEW from the dropdown menu, followed by Options->Change Folder and View Options->View->Apply to Folders, because that box is grayed out and can't be clicked.

    So anyway, I think a useful utility script would be one that allows me to pass a starting folder (or shortcut to one) and a view specification (like DETAILS), and have that script recursively traverse all folders, setting every one it finds to the desired view. I think I've seen scripts like this for setting file/folder permissions, but I'm not well versed enough in VBS script writing, nor how and where in the registry (I assume?) to make these settings via script. Perhaps there is an easier approach to this, but a script is the first thing that came to mind.

    Any help appreciated.
      My Computer


  2. Posts : 18,034
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #2

    Hello @PeterPan2000,

    Is this of any use [ including Related Tutorials at the bottom of this Tutorial ]? =>

    Apply Folder View to All Folders of Same Type in Windows 10.

    I hope this helps!
      My Computer


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

    Paul Black said:
    Hello @PeterPan2000,

    Is this of any use [ including Related Tutorials at the bottom of this Tutorial ]? =>

    Apply Folder View to All Folders of Same Type in Windows 10.

    I hope this helps!
    Thanks but no its not what I'm looking for. Note the first sentence in my second paragraph. The only thing I could think of in that article that would be helpful is if I knew how to create a folder "template". Maybe then I could re-create the FTP shortcut to use it. Don't know. However I HAVE tried creating a new folder on the desktop, setting that folder to be optimized for "Documents", and then inside the folder created a new shortcut, and specified the FTP location and credentials. Upon opening that shortcut it functions identically to the original FTP shortcut I made on my desktop. It works, but when i 'explore' it, the default for all folders seems to be to view ICONs.
    Last edited by PeterPan2000; 18 Apr 2020 at 15:44.
      My Computer


  4. Posts : 11,246
    Windows / Linux : Arch Linux
       #4

    Hi there

    @PeterPan2000

    perhaps not the answer you are looking for but why not simply use filezilla (free for windows) -- shows both local and remote directories in the view you want

    I'm on a Linux box currently but the command and windows are identical to what is displayed in the windows version

    IMO much better than mucking around with Windows File explorer -- and long path/file names (>266 chars) also displayed --file explorer displays those as 8.3 names BTW)

    Need a script to recursively change folder view properties-screenshot_20200419_100756.png

    To send / receive files simply right mouse click on appropriate file(s) for send use left hand lower pane --will xfer to directory selected in top right hand pane -- to receive from remote right mouse click on file(s) in right hand lower pane and it will send to directory in top left hand pane. All panes are scrollable --if your web server can't do sftp then standard ftp works. use ftp in the target host instead of sftp. Very quick and easy program to use.

    Download FileZilla Client


    cheers

    jimbo
      My Computer


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

    jimbo45 said:
    Hi there

    @PeterPan2000

    perhaps not the answer you are looking for but why not simply use filezilla (free for windows) -- shows both local and remote directories in the view you want


    jimbo
    Thanks. I do already use filezilla. The folder shortcuts are just another convenience, and programmatically traversing a directory tree and setting folder properties is something both useful for my request, and would be worth learning how to do.

    Since this forum is apparently not the place to ask such questions, any suggestions on where to ask?
      My Computer


  6. Posts : 23
       #6

    Newest Questions - Stack Overflow

    Is a very good site to get answers for Batch and script questions.

    Loki
      My Computer


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

    loki said:
    Newest Questions - Stack Overflow

    Is a very good site to get answers for Batch and script questions.

    Loki

    Sadly that is the worst place to ask any question like this requiring explanation and detail. After posting this request in stackoverflow it only took 2 days for it to receive 2 downvotes, a useless (what have you tried so far) comment, and finally the question was closed. Oh well. Thanks anyway.
      My Computer


  8. Posts : 989
    Microsoft Windows 10 Home
       #8

    Hi. We should be able to figure this out. You say the top-view is saved through re-boot. That implies it's saved like other folder views, as a sub-key of either:
    Code:
    HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags
    or
    Code:
    HKCU\Software\Microsoft\Windows\Shell\Bags
    and therefore we should be able to determine what folder template it uses and/or set inheritance for a parent folder.

    You need to download Process Monitor and run with the following filters:
    • Operation is RegSetValue
    • Path contains Bags

    then open your FTP site, modify some aspect of the view, and close. Save the fresulting log as .csv & post the path of the bag where the view is stored.
      My Computer


  9. Posts : 16,981
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #9

    loki said:
    Newest Questions - Stack Overflow
    Is a very good site to get answers for Batch and script questions.
    Loki
    Is a very good site to get coding suggestions in response to code posted by the questioner.

    They make very clear in their Help section that questions should be about code -
    How do I ask a good question?
    What topics can I ask about here?
    What types of questions should I avoid asking?

    Denis
      My Computer


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

    KeithM said:
    Hi. We should be able to figure this out. You say the top-view is saved through re-boot. That implies it's saved like other folder views, as a sub-key of either:
    Code:
    HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags
    or
    Code:
    HKCU\Software\Microsoft\Windows\Shell\Bags
    and therefore we should be able to determine what folder template it uses and/or set inheritance for a parent folder.

    You need to download Process Monitor and run with the following filters:
    • Operation is RegSetValue
    • Path contains Bags

    then open your FTP site, modify some aspect of the view, and close. Save the fresulting log as .csv & post the path of the bag where the view is stored.
    Thanks! well OK... I installed and ran it (the 64 bit version), and set the two filters you described. I started it at 6:20PM (EST). Before I could get to testing that FTP shortcut, it listed 16 items from the Explorer.exe process with Operation=RegSetValue, and I noticed that in the status area of the Process Monitor app, was saying...

    Showing 16 of 9,134,867 event (0.00016%)

    Those 16 events were all with the Explorer.EXE "process name", and timestamped starting at 6:20 (the time I began running the program), and these were all indeed RegSetValue operations, with BAGs in the path. The event count was continuing to increase, and the % shown was slowly decreasing. I don't know what this means since I'm not running anything yet. As I type this the count has passed 22 million! I do know Explorer.EXE is the process running the shortcut which is my FTP link, but again I was not running it (and have not started it) yet. So I figured I'll let it complete whatever its doing before I do anything else. While it counting these tens of millions of operations, I guess its a good time to ask for a clarification...

    1) Should I somehow CLEAR the list before starting the FTP shortcut and start a new log somewhere?
    2) Do I need to start this log, or is the Process monitor already recording one somewhere?

    I'm asking because if this program is recording 30 million items, I would think I shouldn't attempt to post it here.

    OH and by the way... I did open regedit and could not find

    Code:
    HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags
    (There was no "Software" key in the above tree, but I DID find...

    Code:
    HKCU\Software\Microsoft\Windows\Shell\Bags
    And it did have a handful of numbered keys in it, but I didn't find anything that would point me to a relation to the name of the shortcut that does the FTP.
      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 05:28.
Find Us




Windows 10 Forums