Skip to content

windows_update_reset.ps1

Corey Watson edited this page Dec 24, 2025 · 2 revisions

windows_update_reset.ps1

Completely reset Windows Update components.

Overview

Completely resets Windows Update components by stopping services, clearing caches, resetting security descriptors, re-registering DLLs, and restarting services. Fixes most Windows Update problems.

Purpose

Provides comprehensive Windows Update repair for systems experiencing update failures, stuck updates, or corruption in the update subsystem.

Prerequisites

  • Windows 10/11
  • Admin privileges required
  • Internet connectivity for updates after reset

Configuration

Required Inputs

  • RebootAfterReset: Whether to reboot after reset (default: $false)

Settings

  • Stops: BITS, wuauserv, appidsvc, cryptsvc
  • Clears: SoftwareDistribution, catroot2, QMGR data
  • Resets: BITS and wuauserv security descriptors
  • Registers: 30+ Windows Update related DLLs
  • Resets: Winsock

Behavior

  1. Stops all Windows Update related services
  2. Flushes DNS cache
  3. Clears BITS download queue data
  4. Renames SoftwareDistribution and catroot2 folders
  5. Resets Windows Update policies in registry
  6. Resets BITS and wuauserv security descriptors
  7. Re-registers all Windows Update DLLs
  8. Resets Winsock
  9. Restarts all services
  10. Optionally reboots system

Security Notes

  • No secrets in logs
  • Modifies system registry and service configurations
  • Creates .bak folders for recovery

Exit Codes

  • 0: Success
  • 1: Failure

Example Output

[ INPUT VALIDATION ]
--------------------------------------------------------------
Reboot After Reset : False

[ STOPPING SERVICES ]
--------------------------------------------------------------
Stopping BITS...
Stopping wuauserv...
Stopping appidsvc...
Stopping cryptsvc...

[ CLEARING CACHES ]
--------------------------------------------------------------
Flushing DNS...
Clearing QMGR data...
Renaming SoftwareDistribution...
Renaming catroot2...

[ RESETTING COMPONENTS ]
--------------------------------------------------------------
Resetting security descriptors...
Re-registering DLLs...
Resetting Winsock...

[ STARTING SERVICES ]
--------------------------------------------------------------
Starting BITS...
Starting wuauserv...
Starting appidsvc...
Starting cryptsvc...

[ RESULT ]
--------------------------------------------------------------
Status : Success

[ SCRIPT COMPLETED ]
--------------------------------------------------------------

Version History

  • v1.0.0 (2025-11-29): Initial Style A implementation

Links

Clone this wiki locally