https://lexikos.github.io/v2/docs/commands/Run.htm#RunAs
Code: Select all
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
}
MsgBox "A_IsAdmin: " A_IsAdmin "`nCommand line: " full_command_line
I guess it should open the UAC dialog when i click on the file containing this code - restarting the script as admin.
It does nothing for me. I remember this snippet was working in some of the previous versions, a122 I think.
Please could someone check this, whether it's working for them?