Core Function RunAsSet
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> RunAsSet( <user>, <domain>, <password>, <options> ) </pre> === Description === Initialise a set of user credentials to use during Run and RunWait operations. === Paramet...") |
|||
Line 1: | Line 1: | ||
<pre> | <pre> | ||
− | RunAsSet( <user>, <domain>, <password | + | RunAsSet( <user>, <domain>, <password> ) |
</pre> | </pre> | ||
Line 20: | Line 20: | ||
Optional; The password to use. | Optional; The password to use. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Return Value === | === Return Value === | ||
− | Returns | + | Returns 1--regardless of success. (If the login information was invalid, subsequent Run/RunWait commands will fail....) |
− | + | ||
− | + | ||
=== Remarks === | === Remarks === |
Revision as of 17:51, 1 December 2011
RunAsSet( <user>, <domain>, <password> )
Contents |
Description
Initialise a set of user credentials to use during Run and RunWait operations.
Parameters
username
Optional; The user name to use.
domain
Optional; The domain name to use.
password
Optional; The password to use.
Return Value
Returns 1--regardless of success. (If the login information was invalid, subsequent Run/RunWait commands will fail....)
Remarks
This function allows subsequent Run and RunWait functions to run as a different user (e.g. Administrator).
The "Secondary Logon service" or "RunAs service" must not be disabled if you want this function to work.
To unset the RunAs details, use the function with no parameters: RunAsSet().
Example
// Set the RunAs parameters to use local adminstrator account RunAsSet("Administrator", @DOMAIN, "adminpassword"); // Run registry editor as admin RunWait("regedit.exe"); // Reset user's permissions RunAsSet();