Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



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

08 Apr 2012   #11

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
10 Apr 2012   #12

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
20 Apr 2012   #13

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
.


Reply

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





Thread Tools



Similar help and support threads for2: How can I set this via command-line or registry?
Thread Forum
Solved backup registry in command line Backup and Restore
backup registry in command line Backup and Restore
Solved How to "Duplicate These Displays" via command line or registry? Customization
add folders in indexing options using registry or command line? Performance & Maintenance
Registry Editing from Command Line General Discussion
Command line Registry Permission General Discussion
Command Line General Discussion

Our Sites

Site Links

About Us

Find 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 06:39 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33