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