I found this already solved in the below link but it did not work for me.
I tried several of the codes in that thread but none of them worked.
Can someone recheck them and post the correct one here?
viewtopic.php?t=9832
I am trying it on Windows 8.1.
Open folder in new window using mouse middle click
Re: Open folder in new window using mouse middle click
Code: Select all
#IfWinActive ahk_class CabinetWClass
MButton::
For each, file in getSelected()
Run, explorer.exe "%file%"
Return
#IfWinActive
getSelected() { ; https://www.autohotkey.com/boards/viewtopic.php?style=17&t=60403#p255256 by teadrinker
hwnd := WinExist("A"), selection := []
WinGetClass, class
If (class ~= "(Cabinet|Explore)WClass")
For window in ComObjCreate("Shell.Application").Windows
If (window.hwnd = hwnd)
For item in window.document.SelectedItems
selection.Push(item.Path)
Return selection
}
Re: Open folder in new window using mouse middle click
Thanks because the script did work.
Can it be improved even further.
It is a bit slow. I have to select the folder before I use the middle button to launch it.
I would also like it to launch folders from the navigation pane of the file explorer.
Can it be improved even further.
It is a bit slow. I have to select the folder before I use the middle button to launch it.
I would also like it to launch folders from the navigation pane of the file explorer.
Re: Open folder in new window using mouse middle click
As long as File Explorer is active, you could issue Click as the first action of the hotkey routine. That would select the file under the mouse. Regarding the nav bar, I think that there are some other posts about how to get those selections; I do not recall the details. Others here may know.