Sign in to follow this  
Followers 0
mheikal

Problem with Installing .msi file from Shared folder as Administrator

3 posts in this topic

Hello !

I am trying to creat patch to install .msi file from shared folder using msiexec command as below

msiexec.exe /i "\\server01\Users\New Folder\filename.msi"

but also execute this command as local administrator , thus I worked to creat it with autoit as below

$user="Administrator"
$pass="password"
$comp=@ComputerName

RunAs($user,$comp,$pass,0,"msiexec.exe /i "\\server01\Users\New Folder\filename.msi"")

but I got error message :Unable to parse Line

I have tried also

ShellExecute ("msiexec.exe" , "/i "\\server01\Users\New Folder\filename.msi"")

but I failed

so , How can I solve this issue ?

Thanks in Advance

Share this post


Link to post
Share on other sites



The reason why it didn't work is the quotes. You need to use a different quote to encapsulate something within quotes.

Notice the double quote around the MSIEXEC command and the single quote around the long filename.

Here's the updated code.

$user="Administrator"
$pass="password"
$comp=@ComputerName

RunAs($user,$comp,$pass,0,"msiexec.exe /i '\\server01\Users\New Folder\filename.msi'")

Share this post


Link to post
Share on other sites

Thanks 5t0n3r for your reply, but when I ran the script , it executed msiexec.exe command only without the followed parameters (it gives msiexec.exe help window)

As I when tested before the command from RUN or CMD as below

msiexec.exe /i "\\server01\Users\New Folder\filename.msi"

I had to add double quota with long (shared) file path to make it run and execute msi file

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  
Followers 0