Jump to content

Recommended Posts

Posted

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

Posted

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'")
Posted

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

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
×
×
  • Create New...