Sign in to follow this  
Followers 0
andyjharper

RunAs not working - Does RunAsSet still exist?

8 posts in this topic

Greetings,

I'm trying to install an app for non-admin users on our domain. I did it back in April and now when I create a new one for a different app, it doesn't work. I'm using a real simple script:

RunAs("upgrade", "AD", "Winter08")

RunWait ("C:\upgrade\emr10_24_0012.msi")

RunAs()

The error I get is:

Line -1:

Error: Incorrect number of parameters in function call.

Also, I'm sure I did this as RunAsSet last time and now that lists as an unknown function. Has this changed since I last used AutoIT? At any rate, it acts like I have an invalid user name or password but I know it's correct. Anyone know what my problem is? Thanks for any help.

Share this post


Link to post
Share on other sites



Maybe figured it out (still need to test). I guess you can't run msi files without calling msiexec first. I didn't realize it worked the same way it works via a command prompt.

Greetings,

I'm trying to install an app for non-admin users on our domain. I did it back in April and now when I create a new one for a different app, it doesn't work. I'm using a real simple script:

RunAs("upgrade", "AD", "Winter08")

RunWait ("C:\upgrade\emr10_24_0012.msi")

RunAs()

The error I get is:

Line -1:

Error: Incorrect number of parameters in function call.

Also, I'm sure I did this as RunAsSet last time and now that lists as an unknown function. Has this changed since I last used AutoIT? At any rate, it acts like I have an invalid user name or password but I know it's correct. Anyone know what my problem is? Thanks for any help.

Share this post


Link to post
Share on other sites

That still didn't work either. Same error.

Maybe figured it out (still need to test). I guess you can't run msi files without calling msiexec first. I didn't realize it worked the same way it works via a command prompt.

Share this post


Link to post
Share on other sites

How about RunAsWait?

RunAsWait("upgrade", "AD", "Winter08",1,"MSIEXEC.EXE /I C:\upgrade\emr10_24_0012.msi","C:\upgrade\")

Share this post


Link to post
Share on other sites

How about RunAsWait?

RunAsWait("upgrade", "AD", "Winter08",1,"MSIEXEC.EXE /I C:\upgrade\emr10_24_0012.msi","C:\upgrade\")
Thank you. That seemed to work. What does the logon_flag "1" do?

Share this post


Link to post
Share on other sites

Greetings,

I'm trying to install an app for non-admin users on our domain. I did it back in April and now when I create a new one for a different app, it doesn't work. I'm using a real simple script:

RunAs("upgrade", "AD", "Winter08")

RunWait ("C:\upgrade\emr10_24_0012.msi")

RunAs()

The error I get is:

Line -1:

Error: Incorrect number of parameters in function call.

Also, I'm sure I did this as RunAsSet last time and now that lists as an unknown function. Has this changed since I last used AutoIT? At any rate, it acts like I have an invalid user name or password but I know it's correct. Anyone know what my problem is? Thanks for any help.

You seem to be doing this as though you still had to use RunAsSet(). That function was removed from AutoIt a few versions ago (3.2.11.0 Beta back in January, 2008) and replaced with RunAs() and RunAsWait(). The credentials and the executable are all handled in a single function. There is no more separate process to set up the credentials and clear them afterwords. It should all be one line now, as shown by azure above.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

You seem to be doing this as though you still had to use RunAsSet(). That function was removed from AutoIt a few versions ago (3.2.11.0 Beta back in January, 2008) and replaced with RunAs() and RunAsWait(). The credentials and the executable are all handled in a single function. There is no more separate process to set up the credentials and clear them afterwords. It should all be one line now, as shown by azure above.

:)

That would explain it! Thanks. I guess I had an older version of AutoIT installed before I re-imaged my box a few weeks back.

Share this post


Link to post
Share on other sites

Thank you. That seemed to work. What does the logon_flag "1" do?

CODE

RunAsWait ( "username", "domain", "password", logon_flags, "filename" [, "workingdir" [, flag]] )

Parameters

username: The username to log on with.

domain: The domain to authenticate against.

password: The password for the user.

logon_flags:

0 - Interactive logon with no profile.

1 - Interactive logon with profile.

2 - Network credentials only.

4 - Inherit the calling processes environment instead of the user's.

filename: The name of the executable (EXE, BAT, COM, PIF) to run.

workingdir [optional]: The working directory. If not specified, then the value of @SystemDir will be used.

flag [optional]: The "show" flag of the executed program:

@SW_HIDE = Hidden window (or Default keyword)

@SW_MINIMIZE = Minimized window

@SW_MAXIMIZE = Maximized window

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  
Followers 0