大网数据广告活动
安装更新与部署

Microsoft Standard Installer command-line options

· 52CE 我爱测

See standard command-line options for the Microsoft Standard Installer Msiexec.exe, the app you use to interpret packages and install products.

This article describes standard command-line options for the Microsoft Standard Installer msiexec.exe, the app you use to interpret packages and install products.

Command-line options are case insensitive.

Msiexec sets and returns an error level that corresponds to system error codes.

Note: The Msiexec command-line options are available beginning with Windows Installer 3.0. The Windows Installer command-line options are available with Windows Installer 3.0 and earlier. This article lists the Windows Installer command-line option that corresponds to each Standard Installer option.

/help

Help and quick reference option. Displays the correct usage of the msiexec command, including a list of all switches and behavior. You can display the usage descriptions in the user interface. Incorrect use of any other option invokes this help option.

The equivalent Windows Installer command-line option is /?.

Example

msiexec /help.

/quiet

Quiet display option. The installer runs an installation without displaying a user interface. No prompts, messages, or dialog boxes display to the user. The user can't cancel the installation.

Use the /norestart or /forcerestart standard command-line options to control reboots. If no reboot option is specified, the installer restarts the computer whenever necessary without displaying any prompt or warning to the user.

The equivalent Windows Installer command-line option is /qn.

Examples

msiexec /package Application.msi /quiet

msiexec /uninstall Application.msi /quiet

msiexec /update msipatch.msp /quiet

msiexec /uninstall msipatch.msp /package Application.msi /quiet

/passive

Passive display option. The installer displays a progress bar to the user that indicates that an installation is in progress, but displays no prompts or error messages to the user. The user can't cancel the installation.

Use the /norestart or /forcerestart standard command-line options to control reboots. If no reboot option is specified, the installer restarts the computer whenever necessary without displaying any prompt or warning to the user.

The equivalent Windows Installer command-line option is /qb!- with REBOOTPROMPT=S set on the command line.

Example

msiexec /package Application.msi /passive

/norestart

Never restart option. The installer never restarts the computer after the installation.

The equivalent Windows Installer command line has REBOOT=ReallySuppress set on the command line.

Example

msiexec /package Application.msi /norestart

/forcerestart

Always restart option. The installer restarts the computer after every installation.

The equivalent Windows Installer command line has REBOOT=Force set on the command line.

Example

msiexec /package Application.msi /forcerestart

/promptrestart

Prompt before restarting option. Displays a message that a restart is required to complete the installation and asks the user whether to restart the system now. You can't use this option with the /quiet option.

The equivalent Windows Installer command line has REBOOTPROMPT="" set on the command line.

/uninstall (product)

Uninstall product option. Uninstalls a product.

The equivalent Windows Installer command-line option is /x.

Parameter

<Package>.msi | <ProductCode>

/uninstall (patch)

Uninstall update option. Uninstalls an update patch.

The equivalent Windows Installer command-line option is /I with MSIPATCHREMOVE=Update1.msp | PatchGUID1[;Update2.msp | PatchGUID2] set on the command line.

Example

msiexec /uninstall Update1.msp;PatchGUID2

/log

Log option. Writes logging information into a log file at the specified existing path. The path to the log file location must already exist. The installer doesn't create the directory structure for the log file.

For more information about all the methods that are available for setting the logging mode, see Normal logging for the Windows Installer.

The equivalent Windows Installer command-line option is: /L*.

The following information is entered into the log:

  • Status messages
  • Nonfatal warnings
  • All error messages
  • Startup of actions
  • Action-specific records
  • User requests
  • Initial UI parameters
  • Out-of-memory or fatal exit information
  • Out-of-disk-space messages
  • Terminal properties

/package

Install product option. Installs or configures a product.

The equivalent Windows Installer command-line option is /I.

Parameter

<Package>.msi | <ProductCode>

/update

Install patches option. Installs one or multiple patches.

The equivalent Windows Installer command line has PATCH = [<msipatch>.msp]<;PatchGuid> set on the command line.

Parameter

<Patch>.msp | <PatchGUID>

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 04/29/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。