WUSA - CMD


Overview

The WUSA (Windows Update Stand-alone Installer) command in Windows CMD is used to install and manage Windows updates from a standalone .msu file. It’s primarily used by system administrators and advanced users to automate the deployment of update packages within scripted environments or when manual installation is necessary. This tool is effective for offline updates, updates across multiple machines, or when controlling the specific updates to be applied.

Syntax

The basic syntax for the WUSA command is:

WUSA.exe [PathToFile] [Options]
  • [PathToFile] is the path to the .msu file containing the Windows Update.
  • [Options] include various flags to control the behavior of the installer.

Options/Flags

Here are the key options available with the WUSA command:

  • /quiet: Installs the update without user interaction.
  • /norestart: Prevents the system from restarting after the installation of the update.
  • /forcerestart: Forces the system to restart after the update is applied.
  • /warnrestart: Displays a dialog box to the user with a warning that the system will restart in 30 seconds.
  • /promptrestart: Prompts the user for permission to restart if it is necessary for the completion of installation.
  • /log: Enables logging, use it followed by a path to save the log file.
  • /uninstall: Uninstalls the update. It can be combined with /quiet and /norestart for silent operations.

Examples

  1. Basic Installation of an Update
    WUSA.exe C:\path\to\update.msu
    
  2. Install an Update Silently Without Restarting
    WUSA.exe C:\path\to\update.msu /quiet /norestart
    
  3. Uninstalling an Update
    WUSA.exe C:\path\to\update.msu /uninstall
    
  4. Logging the Installation Process
    WUSA.exe C:\path\to\update.msu /log:C:\path\to\log.txt
    

Common Issues

  1. Installation fails silently: Use the /log option to generate a log file which can be helpful for troubleshooting.
  2. Script execution halts unexpectedly: Ensure that automated scripts handle scenarios where restart might be required, by using the /norestart or /promptrestart flags.
  3. Error “Installer encountered an error”: Check if the update is already installed or if it’s compatible with your system/OS version.

Integration

WUSA can be combined with other CMD commands for more complex operations. For example, you can script it with conditional checks:

IF EXIST C:\path\to\update.msu (
    WUSA.exe C:\path\to\update.msu /quiet /norestart
) ELSE (
    ECHO Update file not found
)

This checks if the update file exists before attempting to install it, thereby reducing errors in automated environments.

  • DISM.exe: Use Deployment Imaging Service and Management tool to service a Windows image (.wim).

For further reading and more detailed information on Windows commands, visit the Microsoft official documentation.