How do you install an MSI with msiexec into a specific directory?

Use TARGETDIR instead of INSTALLDIR. Note that the quote marks for TARGETDIR property are only around the path in the case of spaces.

msiexec /i "msi path" TARGETDIR="C:\myfolder" /qb

Source: https://learn.microsoft.com/en-us/windows/win32/msi/targetdir

Leave a Comment