Use Microsoft’s built-in winmgmt command from an elevated Command Prompt to back up, verify, restore, or repair the Windows Management Instrumentation (WMI) repository. Save a backup before attempting repair, verify the repository before changing it, and reserve a reset for cases where less disruptive troubleshooting has not worked.
What the WMI repository backup contains
The WMI repository, also called the CIM repository, is a collection of files in the Repository folder that work together as a database. It is not a single ordinary file. The winmgmt /backup command packages the repository backup into one compressed file. Microsoft documents the command and its behavior in the Winmgmt command reference.
Run the commands below in an elevated Command Prompt. The executable is located in %Windir%System32wbem; Microsoft says WinMgmt /? lists the available switches. The documented minimum supported versions are Windows Vista for clients and Windows Server 2008 for servers; these are reference baselines, not a guarantee of testing on every current build.
Back up the repository
-
Open Command Prompt as an administrator.
-
Choose a destination folder that already exists and that you can access. For example, create
C:WMI-backupfirst, then run:Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsSpecial offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.#1 Best Overall
SaleWD 2TB Elements Portable External Hard Drive for Windows, USB 3.2 Gen 1/USB 3.0 for PC & Mac, Plug and Play Ready - WDBU6Y0020BBK-WESN- High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
- Plug-and-play expandability
- Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
- SuperSpeed USB 3.2 Gen 1 (5Gbps)
winmgmt /backup C:WMI-backuprepository.bak -
Keep the resulting file somewhere safe. The path after
/backupis the destination, so this example writesrepository.bakinsideC:WMI-backup. The.bakextension is illustrative; Microsoft describes a compressed file but does not require that extension. You may use an external drive as a destination if appropriate, but it is not required.
During backup, WMI takes a write lock and suspends repository write operations until the backup finishes. If you omit the file path, Microsoft says the output is written to %Windir%System32, so specifying a destination makes the saved file easier to locate.
Check repository consistency
To check the live repository, run:
winmgmt /verifyrepository
The command reports whether the repository is consistent. If you need to check a saved repository copy, supply the path to a copy of the entire Repository folder:
winmgmt /verifyrepository C:WMI-backupRepository
This path-based check expects a copied folder, not the compressed file created by /backup. Keep those two backup formats distinct when choosing an input for verification.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- 【Plug-and-Play Expandability】 With no software to install, just plug it in and the drive is ready to use in Windows(For Mac,first format the drive and select the ExFat format.
- 【Fast Data Transfers 】The external hard drives with the USB 3.0 cable to provide super fast transfer speed. The theoretical read speed is as high as 110MB/s-133MB/s, and the write speed is as high as 103MB/s.
- 【High capacity in a small enclosure 】The small, lightweight design offers up to 500GB capacity, offering ample space for storing large files, multimedia content, and backups with ease. Weighing only 0.35 Lbs, it's easy to carry "
- 【Wide Compatibility】Supports PS4 5/xbox one/Windows/Linux/Mac and other operating systems, ensuring seamless integration with game consoles,various laptops and desktops .
- Important Notes for PS/Xbox Gaming Devices: You can play last-gen games (PS4 / Xbox One) directly from an external hard drive. However, to play current-gen games (PS5 / Xbox Series X|S), you must copy them to the console's internal SSD first. The external drive is great for keeping your library on hand, but it can't run the new games.
Restore a compressed backup
Use /restore with the full path to the compressed backup file and a restore flag:
winmgmt /restore C:WMI-backuprepository.bak 0
Flag 0 is the default mode when no users are connected. Flag 1 forces connected users off WMI so the restore can proceed:
winmgmt /restore C:WMI-backuprepository.bak 1
Choose flag 1 only when disconnecting those users is acceptable. Restoring replaces the current repository with the contents of the selected backup. WMI saves the existing repository so it can write it back if the restore fails, but the command reference does not provide a general rule for deciding whether a particular older backup is appropriate.
Repair an inconsistent repository
If verification reports inconsistency, there are two documented repair actions. Microsoft warns that repository errors can be symptoms of problems elsewhere in Windows, and that deleting the repository as a first action can damage Windows or installed applications. Investigate the original WMI or provider error rather than treating a reset as a universal fix.
Rank #3
- Plug-and-play expandability
- SuperSpeed USB 3.2 Gen 1 (5Gbps)
Try salvage to retain readable content
winmgmt /salvagerepository checks consistency and rebuilds the live repository if it is inconsistent, merging content that can be read. This is the less destructive repair choice when the goal is to preserve usable repository data.
Use reset only as a later escalation
winmgmt /resetrepository restores the repository to its initial state from Windows installation. Both salvage and reset restore MOF files that contain #pragma autorecover, but reset is a more consequential change because it returns the repository to that initial state.
Microsoft’s Azure Windows VM Agent troubleshooting procedure gives a scenario-specific escalation: verify the repository, save a copy of the Repository folder, attempt salvage, and use reset only later if the preceding repair does not resolve that Azure agent issue. It is an example for that troubleshooting scenario, not a universal instruction to reset every Windows system.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Choose the least disruptive next step
-
The repository is consistent: do not reset it simply because an application reported a WMI-related error. Continue diagnosing the underlying symptom.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteSpecial offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Rank #4
SaleWD 6TB Elements Portable External Hard Drive for Windows, USB 3.2 Gen 1/USB 3.0 for PC & Mac, Plug and Play Ready - WDBHJS0060BBK-WESN- World’s First 6TB 2.5” Portable Hard Drive
- Plug-and-play expandability
- Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
- SuperSpeed USB 3.2 Gen 1 (5Gbps)
-
The repository is inconsistent: first preserve a backup, then consider
/salvagerepositoryto rebuild while merging readable content. -
Salvage and other diagnosis have not resolved the issue: investigate whether a reset is warranted; it returns the repository to its initial operating-system installation state.
-
You are considering deleting the Repository folder: do not make deletion your first action. Microsoft cautions that it can damage the system or installed applications.
Quick Recap
SaleBestseller No. 1Bestseller No. 2SaleBestseller No. 3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.

