Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Ask for Help (v2) • Re: Run as administator - How?

$
0
0
Thank you! (it works!)
Is there any practical difference between the proposals?

or the solution from the documentation - Run as Administrator?

CODE:

full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try
{
if A_IsCompiled
Run '*RunAs "' A_ScriptFullPath '" /restart'
else
Run '*RunAs "' A_AhkPath '" /restart "' A_ScriptFullPath '"'
}
ExitApp
}


Will check if it is possible to handle UAC with AHK 2.0 - but that may be a new question

Statistics: Posted by Albireo — 50 minutes ago



Viewing all articles
Browse latest Browse all 579

Trending Articles