Code: Select all
#SingleInstance, Force
; Define a hotkey to trigger the command prompt
^!c:: ; Press Ctrl + Alt + C to trigger
; Send the shortcut to open the Run dialog
Send, #r
; Wait for the Run dialog to open
Sleep, 500
; Send the command to open an elevated command prompt
Send, powershell -Command "Start-Process cmd -Verb RunAs"
; Send Enter to execute the command
Send, {Enter}
return