How to Run Windows Update from Command Line (CMD & PowerShell) – BisonKB

How to Run Windows Update from Command Line (CMD & PowerShell)

Posted on 01-01-2025 | Category: General | Views: 59


Method 1: Using Command Prompt (CMD)

  1. Open Command Prompt with Administrator Privileges

    • Press Windows + S, type cmd, and right-click Command Prompt.
    • Select Run as Administrator.
  2. Check Windows Update Status

    • Enter the following command:
      cmd
      Copy code
      wuauclt /detectnow
    • This triggers Windows to check for updates.
  3. Download and Install Updates

    • Use this command:
      cmd
      Copy code
      wuauclt /updatenow
    • It forces Windows to start downloading and installing available updates.
  4. Restart After Updates (Optional)

    • Restart your computer if updates require it:
      cmd
      Copy code
      shutdown /r /t 0

Method 2: Using PowerShell

  1. Open PowerShell with Administrator Privileges

    • Press Windows + S, type PowerShell, and right-click Windows PowerShell.
    • Select Run as Administrator.
  2. Install PowerShell Windows Update Module

    • If not already installed, run:
      powershell
      Copy code
      Install-Module PSWindowsUpdate -Force
  3. Import the Windows Update Module

    • Enter the following command:
      powershell
      Copy code
      Import-Module PSWindowsUpdate
  4. Check for Updates

    • Use the command:
      powershell
      Copy code
      Get-WindowsUpdate
  5. Install Updates

    • Run this command to install updates:
      powershell
      Copy code
      Install-WindowsUpdate -AcceptAll -AutoReboot
    • The -AcceptAll parameter accepts all updates, and -AutoReboot reboots your system if needed.
AI-Recommended Articles
Was this article helpful?
← Back to Home
Advertisement