0

Trying to run this particular msiexec command in powershell is becoming an increasing source of frustration for me. When running the below command with the final 'Practice CS' removed, the command works great. As soon as I add 'Practice CS', the MSI help window appears and the command does not install. Also, simply deleting the space and trying with 'PracticeCS' also works. The space itself is killing the msi process. It is inside of quotes so it should work according to all help available.

msiexec /i PracticeCS.msi SHAREDFILESDIR='\\deployment.contoso.local\d$\Applications\Company\WinCSI\Practice CS\'

EDIT 1: I got it to work with the invocation operator &. I am not sure why the below line works, but it did.

& msiexec /i "\\deployment.contoso.local\d$\Applications\company\wincsi\Practice CS\desktop\MSI\PracticeCS.msi" SHAREDFILESDIR=`"\\deployment.contoso.local\d$\Applications\company\wincsi\Practice CS`" 

(imagine only one backtick at the end. cant get punctuation to display correctly)

Take note that the first /i file path works normally with just regular double quotes.

The path SHAREDFILESDIR worked when using the invocation operator combined with the backtick and double quotes ` and ". Using that at beginning and ending got the installer to work.

Anyone know why?

  • Maybe try the [Windows Installer PowerShell Module](https://stackoverflow.com/a/53436779/129130). – Stein Åsmul Mar 15 '19 at 08:26
  • I think you are missing a second backslash in the UNC path. Shouldn't that be `SHAREDFILESDIR = '\\deployment.contoso.local\d$\Applications\Company\WinCSI\Practice CS\'` ? – Theo Mar 15 '19 at 08:38
  • Or [try this answer](https://stackoverflow.com/a/53442842/129130) from the same "thread" I linked to earlier. – Stein Åsmul Mar 15 '19 at 12:14
  • @Theo When I clicked Edit, there actually is a \\ before deployment. Stack Overflow is removing it for some reason. Imagine it is there. – Ryan Brown Mar 15 '19 at 15:26
  • Ah, yes I see. I have added one extra backslash to complement that. – Theo Mar 15 '19 at 15:31
  • Use four leading spaces, or the `{}` "code sample" button in the editor and the text will be treated as code and not changed so much (normally backslash and backtic are special here). I don't know how PowerShell quotes things so I can't offer an answer. But as it's totally possible to do this right in cmd, it should be possible in PowerShell. – Michael Urman Mar 16 '19 at 03:31

0 Answers0