Core Function RunAsSet

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Undo revision 1066 by UberFoX (talk))
Line 28: Line 28:
  
 
1 = (default) load the user profile
 
1 = (default) load the user profile
 
2 = use for net credentials only
 
  
 
=== Return Value ===
 
=== Return Value ===
  
Returns 0 if the operating system does not support this function.
+
Returns 1--regardless of success. (If the login information was invalid, subsequent Run/RunWait commands will fail....)
 
+
Otherwise returns 1--regardless of success. (If the login information was invalid, subsequent Run/RunWait commands will fail....)
+
  
 
=== Remarks ===
 
=== Remarks ===

Revision as of 17:52, 1 December 2011

RunAsSet( <user>, <domain>, <password>, <options> )

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.

options

Optional;

0 = do not load the user profile

1 = (default) load the user profile

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