Link to home
Start Free TrialLog in
Avatar of Rrech
Rrech

asked on

Runas with msiexec

Hello;

I am still rather new to the runas command, so any help would be greatly appreciated.

I would like to start an MSI install under a logon script.  The script that I have created is purely in test mode right now, however it does not work:

copy y:\install\NEWica32pkg.msi c:\docume~1\%username%\desktop\msifile.msi
path %path%;y:\install
runas /u:%computername%\Administrator "msiexec /i /package c:\docume~1\%username%\desktop\NEWica32pkg.msi"|sanur password
del c:\docume~1\%username%\desktop\sanur.exe
del c:\docume~1\%username%\desktop\NEWica32pkg.msi

When I run this script, everything seems to run fine, except when it gets to the msiexec statement.  I receive a window that states that the installation package could not be opened....  If I run the msiexec statement by it's self, then I do not receive an error.

The Sanur statement is a program that I found that will pipe in the password for runas.  If I remove the Sanur statement, it seems does not change the error.  


Any suggestions are greatly appreciated!

Thank you very much;

Rob

Avatar of Josh Miller
Josh Miller
Flag of United States of America image

> copy y:\install\NEWica32pkg.msi c:\docume~1\%username%\desktop\msifile.msi

You are copying the msi file to the desktop and renaming it to "msifile.msi" in the process but later when you call msiexec, you use the original filename of NEWica32pkg.msi.  Are you sure this script works fine without the runas?

If that was just a typo on your part, another thing to try is to provide the full path to msiexec which is usually:
%windir%\system32\msiexec.exe

Try using that ^^^^^^^ instead of just msiexec
Avatar of Rrech
Rrech

ASKER

sorry that was a typo on my part.  NEWica32pkg was one of the apps that I was trying to push out.  I copied the script directly, then renamed the newica32pkg names to msi file.


I tried what you suggested with using the full path..... I still recieved the same error.




ASKER CERTIFIED SOLUTION
Avatar of Josh Miller
Josh Miller
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial