Windows Installer commandline options (msiexec for MSI files)

Published by Claro Software on

msiexec is the commandline program you call when writing batch scripts to install and uninstall Windows Installer MSI files.

You use it like this to install:

msiexec /I myproduct.msi

The MSI file can be on a network share:

msiexec /I \\SHARED\Installers\myproduct.msi

Use quotation marks if you have a space in any of the paths:

msiexec /I "\\SHARED\Claro Installers\myproduct.msi"

Silent and passive installations

You can hide the user interface, so no-one has to click “OK” or “Next”. This can be useful if you are trying to automate installation, on a network for example.

You can make installation not prompt the user but have a progress bar:

msiexec /I myproduct.msi /passive

msiexec /X {BEAB8F8C-199F-4Cf7-B28C-11DEF0AF6F1F} /passive

You can make installation not be visible at all (silent):

msiexec /I myproduct.msi /qn

msiexec /X {BEAB8F8C-199F-4Cf7-B28C-11DEF0AF6F1F} /qn

Licence keys

You can set the licence key for versions that require a key. This can be combined with a silent/passive installation to automate installation of the software:

msiexec /I ClaroRead.msi /passive LICENCEKEY=HJEF-JKFIW-JWKEF-WERS

msiexec /I "\\SHARED\Claro Installers\ClaroRead.msi" /passive LICENCEKEY=HJEF-JKFIW-JWKEF-WERS

Selecting what is installed

You can selectively not install a feature:

msiexec /I myproduct.msi ADDLOCAL=ALL REMOVE=MyFeature /passive

You can use the free Orca program from Microsoft to identify the Features in an MSI file. How to use the Orca database editor to edit Windows Installer files


You can uninstall if you know the product code or you can use the original MSI:

msiexec /X {BEAB8F8C-199F-4Cf7-B28C-11DEF0AF6F1F}

msiexec /X myproduct.msi

This page was last updated on 11th February 2021.