Last active
March 1, 2025 04:23
-
-
Save heiswayi/d829830283f1f812f894ec4f3c8367f9 to your computer and use it in GitHub Desktop.
Cmder Hotkey using AutoHotkey - https://www.autohotkey.com/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Press Ctrl + ` to open Cmder in the current File Explorer directory | |
^`:: | |
{ | |
; Get the path of the active File Explorer window | |
Path := Explorer_GetPath() | |
if Path | |
{ | |
; Run Cmder and set the working directory | |
Run, "C:\cmder\Cmder.exe" /START "%Path%" | |
} | |
else | |
{ | |
; If no Explorer window is active, open Cmder in default location | |
Run, "C:\cmder\Cmder.exe" | |
} | |
} | |
return | |
; Function to get the current directory of active File Explorer | |
Explorer_GetPath() | |
{ | |
WinGet, winid, ID, A | |
for window in ComObjCreate("Shell.Application").Windows | |
{ | |
if (window.hwnd = winid) | |
return window.Document.Folder.Self.Path | |
} | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment