Jump to content
Sign in to follow this  

Runasset Will Work In Xp Sp2 And 2003 Server?

Recommended Posts


Will RunAsSet will work in XP SP2 and 2003 Server? I tried using in my scripts to run scripts remote machines, but it fails.

Any input will be good.

Share this post

Link to post
Share on other sites

from the Help file

Initialise a set of user credentials to use during Run and RunWait operations. 2000/XP or later ONLY.

RunAsSet ( ["user", "domain", "password" [, options]] )


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, 2 = use for net credentials only

Return Value

Returns 0 if the operating system does not support this function.

Otherwise returns 1--regardless of success. (If the login information was invalid, subsequent Run/RunWait commands will fail....)


This function allows subsequent Run and RunWait functions to run as a different user (e.g. Administrator). The function only works on the 2000/XP (or later) platforms. NT4 users should install and use the SU command from the NT Resource Kit.

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().


Run, RunErrorsFatal (Option), RunWait


; Set the RunAs parameters to use local adminstrator account

RunAsSet("Administrator", @Computername, "adminpassword")

; Run registry editor as admin


; Reset user's permissions


If that doesn't answer your question, you might need beta

Share this post

Link to post
Share on other sites

from the Help file

If that doesn't answer your question, you might need beta

RUNASSET does not work in BETA and in current version, I am trying to execute my Autoit script remotely and I used first line in my script as RUNASSET.

runas("comp1", "RU","AUTOIT123")


WinWaitActive("Untitled - Notepad")

Send("This is some text.")

WinClose("Untitled - Notepad")

WinWaitActive("Notepad", "The text in the Untitled file has changed")


WinWaitActive("Save As","")




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.