Run MSI from Command Line
XP SP2
I'm doing some testing, and as part of the test I want to try running an MSI
file with elevated privileges from a standard user account. I'm logged in
with a standard user account and I want to run the MSI with administrative
rights. There is no "Run as" option on the context menu for MSI files, but
I found some information which indicates that it may be possible to run the
file from the command line by using "runas" to launch MSIEXEC.EXE and
specifying the MSI package. Here is the command that I am using:
runas /user:Administrator "msiexec /i OdysseyClient.msi"
When I execute the command I get prompted for the administrator password,
and after I enter the password I get a Windows Installer dialog box showing
me the command syntax. The MSI file never gets launched. I've tried a
number of different syntax options with no luck.
Can someone tell me if what I'm attempting is possible? If so, what is the
correct syntax?
--Tom
RE: Run MSI from Command Line
When running from things from the command-line, I recommend that you always
think in terms of the 8.3 format. If you type DIR /X on the command line,
you will see both formats and you can translate OddysseyClient.msi to
ODDYSS~1.MSI.
Since you are running in another context, you might also specify the path to
the MSI file; also in 8.3 format. See the sample below:
runas /user:administrator "msiexec /i c:\patches\hivecl~1\oddyss~1.msi"
Vinson
"Thomas M." wrote:
> XP SP2
>
> I'm doing some testing, and as part of the test I want to try running an MSI
> file with elevated privileges from a standard user account. I'm logged in
> with a standard user account and I want to run the MSI with administrative
> rights. There is no "Run as" option on the context menu for MSI files, but
> I found some information which indicates that it may be possible to run the
> file from the command line by using "runas" to launch MSIEXEC.EXE and
> specifying the MSI package. Here is the command that I am using:
>
> runas /user:Administrator "msiexec /i OdysseyClient.msi"
>
> When I execute the command I get prompted for the administrator password,
> and after I enter the password I get a Windows Installer dialog box showing
> me the command syntax. The MSI file never gets launched. I've tried a
> number of different syntax options with no luck.
>
> Can someone tell me if what I'm attempting is possible? If so, what is the
> correct syntax?
>
> --Tom
>
>
>
Re: Run MSI from Command Line
I added the full path to the file and that did the trick--the command now
works. The 8.3 format didn't seem to matter for me, however, in my case the
full path and file name does not contain any spaces, so I don't know if
spaces would make a difference or not.
--Tom
"Vinson" <Vinson@discussions.microsoft.com> wrote in message
news:515F496A-B650-4420-A549-10E4540D5809@microsoft.com...
> When running from things from the command-line, I recommend that you
> always
> think in terms of the 8.3 format. If you type DIR /X on the command line,
> you will see both formats and you can translate OddysseyClient.msi to
> ODDYSS~1.MSI.
>
> Since you are running in another context, you might also specify the path
> to
> the MSI file; also in 8.3 format. See the sample below:
>
> runas /user:administrator "msiexec /i c:\patches\hivecl~1\oddyss~1.msi"
>
> Vinson
>
> "Thomas M." wrote:
>
>> XP SP2
>>
>> I'm doing some testing, and as part of the test I want to try running an
>> MSI
>> file with elevated privileges from a standard user account. I'm logged
>> in
>> with a standard user account and I want to run the MSI with
>> administrative
>> rights. There is no "Run as" option on the context menu for MSI files,
>> but
>> I found some information which indicates that it may be possible to run
>> the
>> file from the command line by using "runas" to launch MSIEXEC.EXE and
>> specifying the MSI package. Here is the command that I am using:
>>
>> runas /user:Administrator "msiexec /i OdysseyClient.msi"
>>
>> When I execute the command I get prompted for the administrator password,
>> and after I enter the password I get a Windows Installer dialog box
>> showing
>> me the command syntax. The MSI file never gets launched. I've tried a
>> number of different syntax options with no luck.
>>
>> Can someone tell me if what I'm attempting is possible? If so, what is
>> the
>> correct syntax?
>>
>> --Tom
>>
>>
>>