1

I am trying to install msi from commandline using powershell command. My msi path contains R character after parenthesis. Due to this powershell throws below error.

PowerShell.exe -ExecutionPolicy Bypass Start-Process -Wait -FilePath msiexec -ArgumentList /i, `"c:\program files\xxx (R) xxx.msi`"

enter image description here

If my path contain no parenthesis, it is working fine. Can someone help me resolve this issue. Do not suggest some other method to do it. I would like to know the path issue as it works when my msi path doesnt have parenthesis.

Arun
  • 2,247
  • 3
  • 28
  • 51

1 Answers1

1

From PowerShell:

# Note that parameter -FilePath is implied for `msiexec`, and
# -ArgumentList for `'/i ...'`
Start-Process -Wait msiexec '/i "c:\program files\xxx (R) xxx.msi"'

The most robust approach is to use a single -ArgumentList (-Args) argument that encodes all arguments, using embedded quoting, rather than passing arguments individually, due to a long-standing bug detailed in this answer.


From cmd.exe, there's no reason to involve PowerShell in this case; the built-in start command will do:

start /wait msiexec /i "c:\program files\xxx (R) xxx.msi"

mklement0
  • 382,024
  • 64
  • 607
  • 775