Solved

Runas with msiexec

Posted on 2004-10-11
3
8,548 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

726 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