Windows 7 / Getting Started

How to Script Update Installations

Windows 7 opens MSU files with the Windows Update Standalone Installer (Wusa.exe). To install an update from a script, run the script with administrative privileges, call Wusa, and provide the path to the MSU file. For example, you can install an update named Windows6.1-KB961367-x86.MSU in the current directory by running the following command.

wusa Windows6.1-KB961367-x86.MSU

Additionally, Wusa supports the following standard command-line options:

  • /?, /h, or /help Displays the command-line options.
  • /quiet Quiet mode. This is the same as unattended mode, but no status or error messages are displayed. Use quiet mode when installing an update as part of a script.
  • /norestart Does not restart when installation has completed. Use this parameter when installing multiple updates simultaneously. All but the last update installed should have the /norestart parameter.

Scripting is not usually the best way to install updates on an ongoing basis. Instead, you should use Automatic Updates, WSUS, or Configuration Manager 2007 R2. However, you might create a script to install updates on new computers or to install updates on computers that cannot participate in your standard update distribution method.

[Previous] [Contents] [Next]