How can I set this via command-line or registry?

Page 2 of 2 FirstFirst 12

  1. Posts : 640
    Windows 7 Ultimate x64
       #11

    The /e switch doesn't actually change it to details view if the folder was last closed in a different view.

    The following script will open in list view. Copy the code to a text file, change the bold text to the correct values and save as filename.vbs. It's not via the cmd line but it's the only option I know of.
    Code:
    Dim WshShell
    
    Set WshShell = WScript.CreateObject("WScript.Shell")
    
    'Set the String to run and run it.
    WshShell.run """X:\folder\sub folder"""
    
    'Wait until the application has loaded - Check every second
    While WshShell.AppActivate("folder name") = FALSE
    wscript.sleep 1000
    Wend
    
    'Bring the application to the foreground and wait 1 second
    WshShell.AppActivate "folder name"
    WScript.Sleep 1000
    
    'Send ALT+V then the L key to bring down the view menu and change
    'to list view then wait half a second
    WshShell.SendKeys "%VL"
    WScript.Sleep 500
    
    'Cleanup
    Set WshShell = Nothing
    I did try to open in details view and send CTRL + Numpad Plus and I could send CTRL + Plus Sign but it did not work, I couldn't find a way to send the correct Numpad Plus.

    I did post the question on a different forum so if I get an answer I update here but it looks like it may not be possible.

    EDIT: You can then put this script into your Start Menu startup folder. If you find this isn't working it might be because on startup other programs that are loading are taking focus away from the Explorer window. You can try to counteract that by adding a new line "wscript.sleep 60000" as the first line to wait 1min before running the rest then reduce the wait until it no longer works and fine tune it with 5-10sec longer for the odd slower startup.
      My Computer


  2. Posts : 640
    Windows 7 Ultimate x64
       #12

    I've seen your been on since I last posted, got any feedback on my method. If you like I've got some changes to the script that sizes all columns to fit under details view, change a sendkey add a few more.... I really do hate giving up.
      My Computer


  3. Posts : 640
    Windows 7 Ultimate x64
       #13

    If anyone want's it. Opens Details view and auto fits columns. Change the bold text to the correct values and save as .vbs
    Code:
    Dim WshShell
    
    Set WshShell = WScript.CreateObject("WScript.Shell")
    
    'Open the Folder.
    WshShell.run """C:\Folder\Sub Folder"""
    
    'Wait until the application has loaded - Check every second
    While WshShell.AppActivate("Sub Folder") = FALSE
    wscript.sleep 1000
    Wend
    
    'Bring the application to the foreground and wait half a second
    WshShell.AppActivate "Sub Folder"
    WScript.Sleep 500
    
    'Send ALT+V, D key to bring down the view menu and change
    'to details view then wait half a second
    WshShell.SendKeys "%VD"
    WScript.Sleep 500
    
    'Bring the application to the foreground again, just in case
    'Send ALT+E, A - Open Edit Menu and Select all
    'F6 - Select Column Headings
    'Shift+F10 - Activate right click menu
    'Down Arrow then Enter - Select Size all columns to fit and issue it
    'F5 - Refresh to deselect all items
    WshShell.AppActivate "Sub Folder"
    WshShell.sendkeys "%EA{F6}(+{F10}){DOWN}{ENTER}{F5}"
    
    'Cleanup
    Set WshShell = Nothing
      My Computer


 
Page 2 of 2 FirstFirst 12

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

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