Skip to content

Instantly share code, notes, and snippets.

@heiswayi
Last active March 1, 2025 04:23
Show Gist options
  • Save heiswayi/d829830283f1f812f894ec4f3c8367f9 to your computer and use it in GitHub Desktop.
Save heiswayi/d829830283f1f812f894ec4f3c8367f9 to your computer and use it in GitHub Desktop.
Cmder Hotkey using AutoHotkey - https://www.autohotkey.com/
; 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