Solved

Runas with msiexec

Posted on 2004-10-11
3
8,452 Views
Last Modified: 2013-11-14
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

0
Comment
Question by:Rrech
  • 2
3 Comments
 
LVL 2

Expert Comment

by:Dudge669
ID: 12322059
> 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
0
 

Author Comment

by:Rrech
ID: 12323229
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.




0
 
LVL 2

Accepted Solution

by:
Dudge669 earned 100 total points
ID: 12339029
Get the simple whoami.exe resource kit utility if you don't already have it....

http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/whoami-o.asp

As a test change your runas line to this and see if it loads correctly...

runas /u:%computername%\Administrator "%comspec% /k whoami"|sanur password

If that doesn't work you have an authentication problem.  What I have done in the past when loading msiexec as an admin is to load the entire batch file using runas instead of just the msiexec line.  That seems to work better from my experience.  Try getting rid of the runas stuff on your msiexec line and then run the whole batch file using runas.  Or make a small batch file with just the msiexec part and call it from another batch file with runas.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This is about my first experience with programming Arduino.
If you don't know how to downgrade, my instructions below should be helpful.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now