Jump to content
Sign in to follow this  
LurchMan

Help With RunAs and MSIEXEC

Recommended Posts

LurchMan

Hey Everyone -

I'm trying to make a simple script that is going to silently install a program using admin rights but I can't seem to get it to work right.

I've tried:

RunAs ("administrator", @ComputerName, "password", 0, "msiexec /i ffx30client-2.0.5.msi /quiet")

Run ("msiexec /a ffx30client-2.0.5.msi /quiet")

And the only thing that works is this, but it wont run with admin rights:

Run ("msiexec /i ffx30client-2.0.5.msi /quiet")

If anyone has any ideas on how I could get this to work I'd appreciate it.

Thanks

LurchMan


Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
MHz

Try suppling a path to ffx30client-2.0.5.msi.

RunAs ("administrator", @ComputerName, "password", 0, 'msiexec /i "path\to\ffx30client-2.0.5.msi" /quiet', @TempDir)

and a working directory may help.

Share this post


Link to post
Share on other sites
LurchMan

Thank you for the reply, but that didn't fix it. I decided to take out the quiet switch to see what happens and I get this error message...I'm starting to think its wonderful Windows unless you have any other ideas

Edit: Never mind, it generally helps if you use quotes when specifying a path like that huh?

error.bmp

Edited by LurchMan

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
MHz

Edit: Never mind, it generally helps if you use quotes when specifying a path like that huh?

Well, yes, it does. :idea:

My example shows the use of quoting. So, I guess it is working now?

Share this post


Link to post
Share on other sites
LurchMan

Yes it does, Thank you for your time and help.


Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

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.