Extract files from an MSI package

Home » Windows Server » Extract files from an MSI package

In Windows you can extract the contents of an MSI package (.msi file) using the command line or via a script. I keep forgetting the correct msiexec.exe syntax to use to extract files from an .msi file (MSI package)… So here is a short post with the command-line syntax.

To extract all files from a .msi file, use the following msiexec.exe command and arguments.

An MSI package (Microsoft Installer package) is a Windows-specific file format used to install, configure, and remove software. It’s managed by the Windows Installer service (msiexec.exe), handling everything from file installation to registry changes, shortcuts, and rollback procedures. It is the Windows-native installer format

To extract all files from a .msi file, use the following msiexec.exe command:

& C:\Windows\System32\msiexec.exe /a C:\Users\user\path\to\file.msi /qb TARGETDIR=C:\Users\users\temp

A more PowerShell way is to use Start-Process:

Start-Process `
  -NoNewWindow C:\Windows\System32\msiexec.exe `
  -ArgumentList "/a C:\Users\user\path\to\file.msi /qb TARGETDIR=C:\Users\users\temp" `
  -Wait

Make sure you type out full paths and the destination directory must exist. Here are the msiexec.exe command arguments used to extract files:

  • /a: Specifies administrative installation
  • /qb: Specifies there’s a basic UI during the installation process.
  • TARGETDIR=: Represents the installation directory for an InstallScript installation, or for an administrative Windows Installer based installation. This is when the user runs Setup.exe or MsiExec.exe with the /a command-line switch.

You can also use 7-Zip to extract .msi files (read in Dutch “7-Zip installeren“).

An MSI package is the Windows-native installer format – a comprehensive, structured container for application deployment. It offers strong administration, customization, and system-integrity benefits, making it ideal for enterprise scenarios, although it requires more effort to create and manage compared to simpler EXE installers.

In this post I showed you how to extract files from an MSI package.

Jan Reilink
Jan Reilink

In my day to day work, I’m a systems administrator – DevOps / SRE and applications manager at Embrace – The Human Cloud. At Embrace we develop, maintain and host social intranets for our clients. Provide digital services and make working more efficient within various sectors.

Want to support me and donate? Use this link: https://www.paypal.com/paypalme/jreilink.

Articles: 166