Usage
Description
Therepair command attempts to fix issues with installed applications such as corrupted files, missing dependencies, or broken registry entries. It uses the native repair capabilities of the installer type (MSI, MSIX, MSStore) or custom repair switches specified in the package manifest.
The package must be installed for repair to work. Use
winget list to verify the package is installed.Arguments
The query used to search for the package. Can be the package name, ID, or moniker.
Options
Package Selection
Filter by the exact package identifier. Use this for precision when multiple packages match.
Filter by package name.
Filter by package moniker.
Specify the version to repair. If not specified, repairs the installed version.
Limit search to the specified source (e.g.,
winget, msstore).Installer Behavior
Path to a local manifest (YAML) file to use for repair.
Select install scope:
user or machine.Select the architecture:
x86, x64, arm, or arm64.Run the repair in interactive mode with installer UI.
Run the repair in silent mode without user interaction.
Specify the locale to use (e.g.,
en-US, fr-FR).Additional Options
Path to write the log file.
Force the repair operation even if there are warnings.
Accept all package license agreements automatically.
Accept all source license agreements automatically.
Optional Windows-Package-Manager REST source HTTP header.
Examples
Repair by Name
Repair by ID
Repair Specific Version
Silent Repair
Interactive Repair
Repair from Manifest
Repair Behavior by Installer Type
The repair process varies depending on the installer type:Native Repair Support
MSI/WIX Installers
MSI/WIX Installers
Uses the built-in MSI repair feature via
msiexec with default repair options. Repairs the installation by re-copying files and rewriting registry entries.MSIX Packages
MSIX Packages
Uses the Windows MSIX API to re-register the package, which attempts to repair corrupted or missing files.
Microsoft Store Apps
Microsoft Store Apps
Calls the Microsoft Store API (
StartProductInstallAsync) with the repair option to fix the application.Custom Repair Switches
For installer types like Burn, EXE, Nullsoft, and Inno, the manifest must specify:- Repair switch: The command-line argument for repair
- RepairBehavior: How to execute the repair
RepairBehavior Options
| Behavior | Description |
|---|---|
Modify | Uses the ARP ModifyPath with the repair switch |
Uninstaller | Uses the ARP UninstallString with the repair switch |
Installer | Downloads the installer and runs it with the repair switch |
If the manifest doesn’t specify a repair switch for custom installer types, the repair command will fail with an error.
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Repair completed successfully |
| -1978335189 (0x8A15000B) | Package not found |
| -1978335169 (0x8A15001F) | Package not installed |
| -1978335215 (0x8A150011) | Repair not supported for this installer type |
Common Issues
Package not found
Package not found
Verify the package is installed using
winget list. The package must be present on the system to repair it.Repair not supported
Repair not supported
Some installer types (particularly portable apps) don’t support repair. Check the package manifest or try reinstalling instead:
Insufficient permissions
Insufficient permissions
Some repairs require administrator privileges. Run your terminal as administrator and try again.
Related Commands
- winget install - Install or reinstall a package
- winget uninstall - Uninstall a package
- winget list - List installed packages
- winget upgrade - Upgrade packages