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

MKANET

New member
Local time
2:49 PM
Messages
15
How can I set this via command-line or registry? I need a way to automatically launch "Explorer c:\folder\myfolder" with a view appropriate for long filenames on any Windows Vista/Win7 PC.
 

My Computer My Computer

At a glance

Windows 7 64bit Ultimate
OS
Windows 7 64bit Ultimate
Type c:\windows\explorer.exe X:\folder\subfolder /e on Notepad, save as a batch file with .bat extension. Copy file to C:\Users\Your_Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup to open X:\Folder\Subfolder in Explorer in Details view every time you log in to your user account, or to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp if you want this to happen on all user accounts.

Kari
 
Last edited:

My Computer My Computer

At a glance

Windows 10 Pro x64 EN-GB1.6 GHz Intel Core i7-720QM Processor6 GBATI Mobility Radeon HD 5850 Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
HP ENVY 17-1150eg
OS
Windows 10 Pro x64 EN-GB
CPU
1.6 GHz Intel Core i7-720QM Processor
Memory
6 GB
Graphics Card(s)
ATI Mobility Radeon HD 5850 Graphics
Sound Card
Beats sound system with integrated subwoofer
Monitor(s) Displays
17" laptop display, 22" LED and 32" Full HD TV through HDMI
Screen Resolution
1600*900 (1), 1920*1080 (2&3)
Hard Drives
Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media
Cooling
As Envy runs a bit warm, I have it on a Cooler Master pad
Keyboard
Logitech diNovo Media Desktop Laser (bluetooth)
Mouse
Logitech Performance Mouse MX
Internet Speed
50/10 Mbps VDSL
Antivirus
Windows Defender 4.3.9431.0
Browser
Maxthon 3.5.2., IE11
Hi Kari, I need to open a Windows Explorer windows in "List View" or at at least in Details view with automatic resize of all columns from command line. The below solution doesn't have anything to do with displaying long filenames.

Thanks,
MKANET

Type c:\windows\explorer.exe X:\folder\subfolder on Notepad, save as a batch file with .bat extension. Copy file to C:\Users\Your_Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup to open X:\Folder\Subfolder in Explorer every time you log in to your user account, or to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp if you want this to happen on all user accounts.

Kari
 

My Computer My Computer

At a glance

Windows 7 64bit Ultimate
OS
Windows 7 64bit Ultimate
Seems I forgot the /e switch which opens Explorer in Details view. Post edited.

Kari
 

My Computer My Computer

At a glance

Windows 10 Pro x64 EN-GB1.6 GHz Intel Core i7-720QM Processor6 GBATI Mobility Radeon HD 5850 Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
HP ENVY 17-1150eg
OS
Windows 10 Pro x64 EN-GB
CPU
1.6 GHz Intel Core i7-720QM Processor
Memory
6 GB
Graphics Card(s)
ATI Mobility Radeon HD 5850 Graphics
Sound Card
Beats sound system with integrated subwoofer
Monitor(s) Displays
17" laptop display, 22" LED and 32" Full HD TV through HDMI
Screen Resolution
1600*900 (1), 1920*1080 (2&3)
Hard Drives
Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media
Cooling
As Envy runs a bit warm, I have it on a Cooler Master pad
Keyboard
Logitech diNovo Media Desktop Laser (bluetooth)
Mouse
Logitech Performance Mouse MX
Internet Speed
50/10 Mbps VDSL
Antivirus
Windows Defender 4.3.9431.0
Browser
Maxthon 3.5.2., IE11
I know I asked this before, but I guess there's no way to do it... Either to open Explorer in Details View with dynamically adjustable column width from commandline. or...... open in List view. So far everything I've tried requires keypresses from the user.
 

My Computer My Computer

At a glance

Windows 7 64bit Ultimate
OS
Windows 7 64bit Ultimate
This does not require a keypress. A simple one-line batch in Startup is all it takes.

As far as I know there's no way to determine column width from command line. So if it is elementary to show Name column as wide as the longest file name, you need to right click the column title and select Size Column to Fit. If all columns need to be fit, select Size All Columns to Fit.

Kari
 
Last edited:

My Computer My Computer

At a glance

Windows 10 Pro x64 EN-GB1.6 GHz Intel Core i7-720QM Processor6 GBATI Mobility Radeon HD 5850 Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
HP ENVY 17-1150eg
OS
Windows 10 Pro x64 EN-GB
CPU
1.6 GHz Intel Core i7-720QM Processor
Memory
6 GB
Graphics Card(s)
ATI Mobility Radeon HD 5850 Graphics
Sound Card
Beats sound system with integrated subwoofer
Monitor(s) Displays
17" laptop display, 22" LED and 32" Full HD TV through HDMI
Screen Resolution
1600*900 (1), 1920*1080 (2&3)
Hard Drives
Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media
Cooling
As Envy runs a bit warm, I have it on a Cooler Master pad
Keyboard
Logitech diNovo Media Desktop Laser (bluetooth)
Mouse
Logitech Performance Mouse MX
Internet Speed
50/10 Mbps VDSL
Antivirus
Windows Defender 4.3.9431.0
Browser
Maxthon 3.5.2., IE11
Kari, not too many people know this, but Windows does has the ability to dynamically adjust column width in Explorer. In fact, there's even a hotkey for this while in Details view. It doesn't even make any sense to try to predict a fixed width size.

How to open Windows Explorer with auto column width:

Just open explorer in details view....
1. From the command prompt type the following to open current directory: explorer.exe /e, .

2. Press the following key combiation: CTRL + NumPad + (meaning that press CTRL and the + sign on the Numeric Keypad only)

You can also do this by making the change without using the hotkley:

My question was how to do this without manually doing keypresses or manually changing the settings; or, a simple command line argument to switch to list view (similar to the /E switch for Details view). So far the best I can do is use a third party tool to send the CTRL + NumPad + combo to the Window. It does work like that, but, would much rather have a way to do it natively.

This does not require a keypress. A simple one-line batch in Startup is all it takes.

As far as I know there's no way to determine column width from command line. So if is elementary to show Name column as wide as the longest file name, you need to right click the column title and select Size Column to Fit. If all columns need to be fit, select Size All Columns to Fit.

Kari
 

My Computer My Computer

At a glance

Windows 7 64bit Ultimate
OS
Windows 7 64bit Ultimate
As I said, I do not know nor do I believe there's a way to set column width from command line. You solution above is exactly as mine before that with one exception: we both open Explorer in Details view and then set the width, me by right clicking the column title to get it really fixed, or you pressing the key combo wishing you get it right.

Kari
 

My Computer My Computer

At a glance

Windows 10 Pro x64 EN-GB1.6 GHz Intel Core i7-720QM Processor6 GBATI Mobility Radeon HD 5850 Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
HP ENVY 17-1150eg
OS
Windows 10 Pro x64 EN-GB
CPU
1.6 GHz Intel Core i7-720QM Processor
Memory
6 GB
Graphics Card(s)
ATI Mobility Radeon HD 5850 Graphics
Sound Card
Beats sound system with integrated subwoofer
Monitor(s) Displays
17" laptop display, 22" LED and 32" Full HD TV through HDMI
Screen Resolution
1600*900 (1), 1920*1080 (2&3)
Hard Drives
Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media
Cooling
As Envy runs a bit warm, I have it on a Cooler Master pad
Keyboard
Logitech diNovo Media Desktop Laser (bluetooth)
Mouse
Logitech Performance Mouse MX
Internet Speed
50/10 Mbps VDSL
Antivirus
Windows Defender 4.3.9431.0
Browser
Maxthon 3.5.2., IE11
Actually, this is what you said.

"As far as I know there's no way to determine column width from command line. "

"Determining the column width" and "changing a setting to dynamic width" are two completely different things. But, regardless it doesnt look like there's a way to do it without some help.

As I said, I do not know nor do I believe there's a way to set column width from command line. You solution above is exactly as mine before that with one exception: we both open Explorer in Details view and then set the width, me by right clicking the column title to get it really fixed, or you pressing the key combo wishing you get it right.

Kari
 

My Computer My Computer

At a glance

Windows 7 64bit Ultimate
OS
Windows 7 64bit Ultimate
I must be stupid. I was really trying to help you, doing tests, searching and researching. For what? It seems for you to have chance to split hairs and argue about the syntax of my posts?

Let's try other in words, so you can play with them:
- There's no way to determine column width from command line
- You can not set column width dynamic from command line
- You can not change column width from command line

There you go. You choose, I know you will play with my words whatever I say.

I was not awaiting any thanks, you clearly are one that does not feel comfortable to thank. I do this voluntary on my own time, for fun and pleasure. You surely take the fun out of it.

Kari
 

My Computer My Computer

At a glance

Windows 10 Pro x64 EN-GB1.6 GHz Intel Core i7-720QM Processor6 GBATI Mobility Radeon HD 5850 Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
HP ENVY 17-1150eg
OS
Windows 10 Pro x64 EN-GB
CPU
1.6 GHz Intel Core i7-720QM Processor
Memory
6 GB
Graphics Card(s)
ATI Mobility Radeon HD 5850 Graphics
Sound Card
Beats sound system with integrated subwoofer
Monitor(s) Displays
17" laptop display, 22" LED and 32" Full HD TV through HDMI
Screen Resolution
1600*900 (1), 1920*1080 (2&3)
Hard Drives
Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media
Cooling
As Envy runs a bit warm, I have it on a Cooler Master pad
Keyboard
Logitech diNovo Media Desktop Laser (bluetooth)
Mouse
Logitech Performance Mouse MX
Internet Speed
50/10 Mbps VDSL
Antivirus
Windows Defender 4.3.9431.0
Browser
Maxthon 3.5.2., IE11
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 """[B]X:\folder\sub folder[/B]"""

'Wait until the application has loaded - Check every second
While WshShell.AppActivate("[B]folder name[/B]") = FALSE
wscript.sleep 1000
Wend

'Bring the application to the foreground and wait 1 second
WshShell.AppActivate "[B]folder name[/B]"
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 My Computer

At a glance

Windows 7 Ultimate x64Intel Pentium Dual Core E5200 2.5GHz (3.77GHz...Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)Palit GeForce GTS 250 (1024MB)
Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
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 My Computer

At a glance

Windows 7 Ultimate x64Intel Pentium Dual Core E5200 2.5GHz (3.77GHz...Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)Palit GeForce GTS 250 (1024MB)
Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
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 """[B]C:\Folder\Sub Folder[/B]"""

'Wait until the application has loaded - Check every second
While WshShell.AppActivate("[B]Sub Folder[/B]") = FALSE
wscript.sleep 1000
Wend

'Bring the application to the foreground and wait half a second
WshShell.AppActivate "[B]Sub Folder[/B]"
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 "[B]Sub Folder[/B]"
WshShell.sendkeys "%EA{F6}(+{F10}){DOWN}{ENTER}{F5}"

'Cleanup
Set WshShell = Nothing
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Pentium Dual Core E5200 2.5GHz (3.77GHz...Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)Palit GeForce GTS 250 (1024MB)
Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
Back
Top