Msiexec.exe commands

The executable behind the Windows Installer is msiexec.exe. This file is located in C:\WINDOWS\system32 and can be used to control or repair the installation and uninstallation of packages in the command line.

Installing a package

The argument for installing a package is Argument: /i

Command: msiexec /i Package.msi

Repairing a package

Argument: /f - is the argument for repairing a package.

Command: msiexec /f {ProductCode}

Uninstalling a package

Argument: /x - is the argument for uninstalling a package.

Command: msiexec /x {ProductCode}

Administrative Installation

Argument: /a - is the argument for performing an administration installation of a package.

Command: msiexec /a Package.msi TARGETDIR=”C:\temp\yourdesireddrirectory”

Creating logs

Argument: /l - is the argument for making a log.

Command:

  • msiexec /i Package.msi /l LogFile.log - log on installation
  • msiexec /f {ProductCode} /l LogFile.log - log on repair
  • msiexec /x {ProductCode} /l LogFile.log - log when uninstalling

    OBS: Arguments are commutative, with the specification that after each argument, the corresponding information is passed (after an /i an MSI should be passed, after an /l a log file (.log) should be passed).

Applying a patch over a MSI

Argument: /p - is the argument for installing a patch over an MSI.

Command: msiexec /p Patch.msp - the command to install an MSP

The command can also be parsed together with an MSI:

Command: msiexec /i Package.MSI /p Patch.msp

Installation with MST

Command: msiexec /I Package.msi TRANSFORMS = Transform.mst

Check out more options and documentation regarding msiexec commands here.