aboutsummaryrefslogtreecommitdiff
path: root/tt.programs.explorer.ahk
diff options
context:
space:
mode:
Diffstat (limited to 'tt.programs.explorer.ahk')
-rw-r--r--tt.programs.explorer.ahk8
1 files changed, 7 insertions, 1 deletions
diff --git a/tt.programs.explorer.ahk b/tt.programs.explorer.ahk
index 3bebd6d..dead96c 100644
--- a/tt.programs.explorer.ahk
+++ b/tt.programs.explorer.ahk
@@ -32,6 +32,12 @@ ExplorerPath()
return Explorer().Document.Folder.Self.path
}
+RunAsUser(cmd*)
+{
+ global ShellApp
+ return ShellApp.Windows.FindWindowSW(0, 0, 8, 0, 1).Document.Application.ShellExecute(cmd*)
+}
+
;; -> body
;; Explorer/Desktop hotkeys ---------------------------------------------------
@@ -45,7 +51,7 @@ ExplorerPath()
; Open new window/command prompt
^n::Run, % "explorer /n,""" ExplorerPath() """"
-^p::Run, % "cmd /k cd /d """ ExplorerPath() """"
+^p::RunAsUser("cmd", "/k cd /d """ ExplorerPath() """")
+^p::
path := ExplorerPath()