Skip to content

Opening File Explorer TAB Instead of New Window #2680

Discussion options

You must be logged in to vote

So this is the ahk file I've mentioned in Discord. It's based on several scripts I've seen on ahk official forum. You need to set it as the default file explorer in Flow Launcher. A bit buggy and slow but most of the time it works.

Usage:
what_ever_you_like.ahk {-d dir_name|-f file_name}

Code:

#Requires AutoHotkey v2
SetWinDelay 10 ; no delay after window func

if !WinExist("ahk_class CabinetWClass")
{
    if A_Args[1] = "-d"
        ShellExecute(A_Args[2])
    else if A_Args[1] = "-f"
        ShellExecute("/select," A_Args[2])
    return
}
hwnd := OpenNewExplorerTab()
shell := ComObject("Shell.Application")
w := GetActiveExplorerTab(hwnd, shell)
if A_Args[1] = "-d"
    w.Navigate("file:///"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by VictoriousRaptor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants