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
Duzzy

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
Duzzy

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
Duzzy

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
Thread Forum
backup registry in command line
Hello I am trying to back up a registry key, I am using the command >reg export hkey_local_machine\software\microsoft\windows c:\windows\regbackup and I keep getting the error message Unable to write to the file. There may be a disk or file system error. Not sure what I am doing wrong, any ...
Backup and Restore
Registry : How to add extension keys through command line
I am looking for some help: I wish to add a new extension key of type .dns If I execute : reg add HKEY_CLASSES_ROOT\.dns Then the key .dns does not get added to HKEY_CLASSES_ROOT but somewhere in HKEY_CURRENT_USER ? How do I get the command to add the .dns key to HKEY_CLASSES_ROOT ?...
General Discussion
How to "Duplicate These Displays" via command line or registry?
Is there a simple, silent, non-interactive way to switch from "Extend These Displays" to "Duplicate These Displays"?
Customization
add folders in indexing options using registry or command line?
Hello, I'm trying to add folders in the indexing options by using either registry or command lines. This is for an unattended silent install. Any ideas ? Thanks.
Performance & Maintenance
Registry Editing from Command Line
So I am trying to delete some keys from the registry using command line, eventually I am going to turn it into a batch file because it is something I may have to do frequently. Basically I want to delete a folder full of registry keys without having to list every key individually. Anyone have an...
General Discussion
Command line Registry Permission
I found a lot of articles on how to gain full control over a registry key but nothing worked for me. So guys can you help Me?
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 17:44.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App