Keyword Reference


#RequireAdmin

Specifies that the current script requires full administrator rights to run.

#RequireAdmin

Remarks

This function was primarily aimed at allowing AutoIt scripts to work correctly with Windows User Account Control (UAC).

For more details see AutoIt on Windows Vista.

As this function launch a new process, some functions as ConsoleWrite() cannot be captured (SciTE will not display anything).
In case system doesn't have elevation mechanism (e.g. disabled UAC) new process will run under the same user as the original.

Related

IsAdmin

Example

#include <MsgBoxConstants.au3>

#RequireAdmin

If IsAdmin() Then MsgBox($MB_SYSTEMMODAL, "", "The script is running with admin rights.")