Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Use msiexec to Install, Repair, and Uninstall Software via CMD

The msiexec command is a powerful tool in the Windows operating system used to install, repair, and uninstall software packages that use the Windows Installer technology. This command-line utility is essential for system administrators and advanced users who need to automate software management tasks.

What is msiexec?

msiexec is the command-line interface to the Windows Installer, which is responsible for installing, maintaining, and removing software on modern Microsoft Windows systems. It processes MSI (Microsoft Installer) files, which are database files used by the Windows Installer to manage the installation of software.

Basic Syntax

The basic syntax for using msiexec is as follows:

msiexec /Option <Required Parameter> [Optional Parameter]

Common Options and Parameters

  • /i: Installs or configures a product.
  • /x: Uninstalls a product.
  • /f: Repairs a product.
  • /qn: Sets the user interface level to "no UI", which is useful for silent installations.
  • /l*v: Enables verbose logging and specifies the log file path.

Examples

Example 1: Installing a Software Package

To install a software package using an MSI file, you can use the following command:

msiexec /i "C:\path\to\your\installer.msi" /qn /l*v "C:\path\to\log\install.log"

This command installs the software silently (no user interface) and logs the installation process to install.log.

Example 2: Uninstalling a Software Package

To uninstall a software package, you can use the following command:

msiexec /x {PRODUCT-CODE-GUID} /qn /l*v "C:\path\to\log\uninstall.log"

Replace {PRODUCT-CODE-GUID} with the actual product code of the software you want to uninstall. This command will silently uninstall the software and log the process.

Example 3: Repairing a Software Package

To repair an installed software package, use the following command:

msiexec /f "C:\path\to\your\installer.msi" /qn /l*v "C:\path\to\log\repair.log"

This command repairs the software installation using the original MSI file and logs the process.

Discovering Product Codes

To find the product code of installed software, you can use tools like the Windows Registry Editor or third-party software inventory tools. The product code is typically found under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Conclusion

The msiexec command is a versatile tool for managing software installations on Windows. By mastering its options and parameters, you can automate complex software deployment tasks, ensuring consistency and efficiency across multiple systems.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.