Core Function RunAsSet

From Sputnik Wiki
Revision as of 17:51, 1 December 2011 by UberFoX (Talk | contribs)
Jump to: navigation, search
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();
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox