AutoHotkey: Launch App

By Xah Lee. Date: .

Launch App

; launch app by name
Run Notepad
; launch app by path
Run "C:\Windows\explorer.exe"

Open File

; open file
Run "%HOMEPATH%\Documents\todo.txt"
; open folder
Run "%HOMEPATH%\Documents"
; launch app with a parameter
Run "%HOMEPATH%\Downloads\emacs-28.1\bin\runemacs.exe" "-Q"

Set Key to Launch App

Here's how you create a keyboard shortcut for launching Notepad:

; make Win+n start Notepad
#n::Run Notepad

Save the above in a file. Then, double click on it. Then, pressing ❖ Window+n will launch Notepad.

More examples with different keys:

; assign a hotkey to launch a app
#n::Run Notepad     ; Win+n
!n::Run Notepad     ; Alt+n
^n::Run Notepad     ; Ctrl+n

F6::Run Notepad     ; F6
^F6::Run Notepad    ; Ctrl+F6
^!n::Run Notepad    ; Ctrl+Alt+n