/AutoHotkey.docset/Contents/Resources/Documents/commands/RunAs.htm
https://gitlab.com/ahkscript/Autohotkey.docset · HTML · 44 lines · 36 code · 8 blank · 0 comment · 0 complexity · ab35af79e057e4d6eb852371153cba64 MD5 · raw file
- <!DOCTYPE HTML>
- <html>
- <head>
- <title>RunAs</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <link href="../static/theme.css" rel="stylesheet" type="text/css" />
- <script src="../static/content.js" type="text/javascript"></script>
- </head>
- <body>
- <h1>RunAs</h1>
- <p>Specifies a set of user credentials to use for all subsequent uses of <a href="Run.htm">Run</a> and <a href="Run.htm">RunWait</a>.</p>
- <pre class="Syntax">RunAs [, User, Password, Domain]</pre>
- <h3>Parameters</h3>
- <dl>
- <dt>User</dt>
- <dd><p>If this and the other parameters are all omitted, the RunAs feature will be turned off, which restores <a href="Run.htm">Run</a> and <a href="Run.htm">RunWait</a> to their default behavior. Otherwise, this is the username under which new processes will be created.</p></dd>
- <dt>Password</dt>
- <dd><p><em>User</em>'s password.</p></dd>
- <dt>Domain</dt>
- <dd><p><em>User</em>'s domain. To use a local account, leave this blank. If that fails to work, try using @YourComputerName.</p>
- </dd>
- </dl>
- <h3>Remarks</h3>
- <p>This command does nothing other than notify AutoHotkey to use (or not use) alternate user credentials for all subsequent uses of <a href="Run.htm">Run</a> and <a href="Run.htm">RunWait</a>.</p>
- <p><a href="../misc/ErrorLevel.htm">ErrorLevel</a> is not changed by this command. If an invalid <em>User</em>, <em>Password</em>, or <em>Domain</em> is specified, <a href="Run.htm">Run</a> and <a href="Run.htm">RunWait</a> will display an error message explaining the problem (unless their <a href="Run.htm#UseErrorLevel">UseErrorLevel option</a> is in effect).</p>
- <p>While the RunAs feature is in effect, <a href="Run.htm">Run</a> and <a href="Run.htm">RunWait</a> will not able to launch documents, URLs, or system verbs. In other words, the file to be launched must be an executable file.</p>
- <p>The "Secondary Logon" service must be set to manual or automatic for this command to work (the OS should automatically start it upon demand if set to manual).</p>
- <h3>Related</h3>
- <p><a href="Run.htm">Run</a>, <a href="Run.htm">RunWait</a></p>
- <h3>Example</h3>
- <pre class="NoIndent">RunAs, Administrator, MyPassword
- Run, RegEdit.exe
- RunAs <em>; Reset to normal behavior.</em></pre>
- </body>
- </html>