How To Use Msiexec To Install Or Uninstall MSI Files (2026)
The msiexec command installs, repairs and removes Windows Installer (.msi) packages straight from the command line.
Microsoft documents the syntax for Windows 11 and Windows 10, and every option below comes from its pages.
Use it when double-clicking an .msi file fails, when you need a log of a failed install, or when you want a setup with no windows.
Table of Contents
- Quick answer: the msiexec commands
- How to install an MSI file
- Display options: control what you see
- Restart options
- How to uninstall or repair a package
- Write a log file to find out why an install fails
- Set a public property
- What the exit codes mean
- Rules that prevent a 1639 error
- Sources
- More laptop and PC hardware guides
Quick answer: the msiexec commands
| Task | Command (Microsoft’s own examples) |
|---|---|
| Install a package | msiexec.exe /i "C:\example.msi" |
| Install with no windows | msiexec.exe /i "C:\example.msi" /qn |
| Install without restarting | msiexec.exe /i "C:\example.msi" /norestart |
| Install and write a full log | msiexec.exe /i "C:\example.msi" /L*V "C:\package.log" |
| Uninstall a package | msiexec /x msisample.msi |
| Force a repair of every file | msiexec.exe /fa {AAD3D77A-7476-469F-ADF4-04424124E91D} |
Replace the path with the real location of your file, and keep the quotation marks if the path contains spaces.
How to install an MSI file
- Open Command Prompt.
- Type
msiexec.exe /i, then a space, then the full path of the .msi file in quotation marks. - Press Enter and follow the installer, or add a display option from the next section to change what you see.
The /i option is the normal installation, and Microsoft’s older reference says it installs or configures a product.
The /a option does something different: it runs an administrative installation, which installs a product on the network.
Display options: control what you see
| Option | What Microsoft says it does |
|---|---|
| /quiet | Quiet mode, with no user interaction required |
| /passive | Unattended mode that only shows a progress bar |
| /qn | No interface during the installation |
| /qn+ | No interface, except a final dialog box at the end |
| /qb | Basic interface |
| /qb+ | Basic interface with a final dialog box |
| /qr | Reduced interface |
| /qf | Full interface |
Microsoft notes you can add an exclamation mark, as in /qb+!, to hide the Cancel button.
That exclamation mark works only with the basic interface and is not valid with the full interface.
Restart options
If a package changes files that are in use, Microsoft says a restart might be needed before the installation completes.
| Option | Effect |
|---|---|
| /norestart | Stops the device from restarting after the installation completes |
| /promptrestart | Asks you if a restart is required |
| /forcerestart | Restarts the device after the installation completes |
How to uninstall or repair a package
To remove a package, run msiexec /x followed by the .msi file name, as in Microsoft’s example msiexec /x msisample.msi.
Microsoft’s parameter table says /x accepts either the package or a product code.
For a normal program with no .msi file on hand, our guide to uninstalling a program in Windows 11 uses Settings instead.
Repair uses the /f option with a letter, and it needs the package or the product code.
| Repair option | Reinstalls files when |
|---|---|
| /fp | A file is missing |
| /fo | A file is missing or an older version is installed |
| /fe | A file is missing or an equal or older version is installed |
| /fd | A file is missing or a different version is installed |
| /fc | A file is missing or the checksum does not match |
| /fa | Always: all files are reinstalled |
| /fu | All required user-specific registry entries are rewritten |
| /fm | All required computer-specific registry entries are rewritten |
| /fs | All existing shortcuts are overwritten |
The older Microsoft reference says the default for /f is omus, and it warns not to use the v flag for a first installation.
Write a log file to find out why an install fails
Add /L with a letter and a file path, for example msiexec.exe /i "C:\example.msi" /L*V "C:\package.log".
Microsoft says the folder for the log must already exist, because the installer does not create the directory structure.
| Logging option | What it records |
|---|---|
| /li | Status messages |
| /lw | Non-fatal warnings |
| /le | All error messages |
| /lo | Out-of-disk-space messages |
| /lv | Verbose output |
| /l+ | Appends to an existing log file |
| /l* | Everything except verbose and extra debugging information |
To include the verbose and debugging data as well, Microsoft says to use /l*vx.
Set a public property
Only public properties can be set on the command line, and they go after the package, as in msiexec /i A:\Example.msi PROPERTY=VALUE.
Microsoft marks the reverse order as incorrect, so never place the property between /i and the file.
Property names are read as uppercase, and a value that contains spaces must be in quotation marks.
What the exit codes mean
Msiexec sets an error level that matches a Windows system error code when it finishes.
| Code | Microsoft’s description |
|---|---|
| 0 | The action completed successfully |
| 1601 | The Windows Installer service could not be accessed |
| 1602 | The user canceled the installation |
| 1603 | A fatal error occurred during installation |
| 1605 | The action is only valid for products that are currently installed |
| 1612 | The installation source for the product is not available |
| 1618 | Another installation is already in progress |
| 1619, 1620 | The installation package could not be opened |
| 1638 | Another version of the product is already installed |
| 1639 | Invalid command line argument |
| 1641 | The installer initiated a restart, which indicates success |
| 3010 | A restart is required to finish, which indicates success |
Codes 1641 and 3010 are success results, so they do not mean the install failed.
If you see 1618, read our fix for “Another installation is in progress”, and for 1603 on a graphics driver see our AMD Software error 1603 guide.
Rules that prevent a 1639 error
- Do not combine /i, /x, /f, /j, /a, /p, /y and /z in one command, except /p with /a to patch an administrative image.
- /l and /q can be combined with /i, /x, /f, /j, /a and /p.
- Command-line options are not case sensitive.
- Typing /? or /h shows only copyright information, not a list of options.
To open Command Prompt quickly, see how to open the Run dialog in Windows 11.
Sources
- Microsoft Learn: msiexec
- Microsoft Learn: Msiexec.exe command-line options
- Microsoft Learn: MsiExec.exe and InstMsi.exe error messages
More laptop and PC hardware guides
- How To Clean Install MSI Center On Windows (2026)
- How To Install And Fix A TP-Link Bluetooth USB Adapter (2026)
- How To Download And Install Canon EOS Webcam Utility Pro (2026)
- How To Download And Install Dell Display Manager (2026)
- How To Download And Install AcerSense On An Acer PC (2026)
- How To Copy Files To A USB Flash Drive In Windows 11 (2026)