Msiexec.exe: Understanding and Using the Installer Tool

msiexec.exe is a command-line tool used for managing Microsoft Windows Installer packages (.msi files). This tool can perform various operations such as installing, uninstalling, and repairing software. Below are detailed instructions and examples on how to use the msiexec.exe command.

Basic Usage

Installation

To install an .msi file, you can use the msiexec command with the /i parameter:

msiexec /i package.msi

Example:

msiexec /i example.msi

Uninstallation

To uninstall an installed program, you can use the msiexec command with the /x parameter:

msiexec /x {ProductCode}

Example:

msiexec /x {12345678-1234-1234-1234-123456789012}

You can find the product code by using the registry or system auditing tools.

Repair

To repair an .msi installation, you can use the msiexec command with the /f parameter:

msiexec /f package.msi

Example:

Parameters

Here are some important parameters you can use with the msiexec command:

  • /i: Install.

  • /x: Uninstall.

  • /f: Repair.

  • /qn: Quiet installation (no user interface).

  • /qb: Basic user interface installation.

  • /l*v log_file: Generate a detailed log file.

Quiet Installation

To install an .msi file quietly (without a user interface):

Example:

Generating a Log File

To generate a log file during the installation process:

Example:

Customized Installation

Some MSI files allow for the selection of specific features or settings. You can specify these features using the PROPERTY=VALUE format:

Example:

Examples

Basic Installation

Quiet Installation

Uninstallation

Installation with Log File

Customized Quiet Installation

Conclusion

msiexec.exe is a powerful tool for software deployment and management in a Windows environment. The examples and parameters above show how the msiexec command can be used in various scenarios. For more information, you can refer to the official Microsoft documentation.

Last updated