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.msiExample:
msiexec /i example.msiUninstallation
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.msiExample:
msiexec /f example.msiParameters
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):
msiexec /i package.msi /qnExample:
msiexec /i example.msi /qnGenerating a Log File
To generate a log file during the installation process:
msiexec /i package.msi /l*v log.txtExample:
msiexec /i example.msi /l*v install_log.txtCustomized Installation
Some MSI files allow for the selection of specific features or settings. You can specify these features using the PROPERTY=VALUE format:
msiexec /i package.msi PROPERTY1=VALUE1 PROPERTY2=VALUE2Example:
msiexec /i example.msi INSTALLDIR="C:\Program Files\Example" ADDLOCAL=Feature1,Feature2Examples
Basic Installation
msiexec /i example.msiQuiet Installation
msiexec /i example.msi /qnUninstallation
msiexec /x {12345678-1234-1234-1234-123456789012}Installation with Log File
msiexec /i example.msi /l*v install_log.txtCustomized Quiet Installation
msiexec /i example.msi INSTALLDIR="C:\Program Files\Example" ADDLOCAL=Feature1,Feature2 /qnConclusion
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