Skip to content

Instantly share code, notes, and snippets.

@wontoncc
Created October 23, 2017 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wontoncc/6ca3edf95de1b9c22b0fca9156aebeab to your computer and use it in GitHub Desktop.
Save wontoncc/6ca3edf95de1b9c22b0fca9156aebeab to your computer and use it in GitHub Desktop.
AHK2: Open Command Line Here in Explorer with Hotkey
@cd/D "%*"
@cmd /k
#If WinActive("ahk_class CabinetWClass") ; explorer
F8::
for window in ComObjCreate("Shell.Application").Windows
try Fullpath := window.Document.Folder.Self.Path
Run "cmd", Fullpath
return
F9::
for window in ComObjCreate("Shell.Application").Windows
try Fullpath := window.Document.Folder.Self.Path
Run '*RunAs "path\to\cmd-admin-here.bat" ' Fullpath ; see the .bat above
return
#If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment