Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

  1. Open Command Prompt as an administrator.

  2. Choose a destination folder that already exists and that you can access. For example, create C:WMI-backup first, then run:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    #1 Best Overall
    Sale
    WD 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

  3. Keep the resulting file somewhere safe. The path after /backup is the destination, so this example writes repository.bak inside C:WMI-backup. The .bak extension 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Kosbees 500 GB External Hard Drives,Portable Hard Drive for Windows,Ultra Slim External HDD Store Compatible with PC, MAC,Laptop,PS4, Xbox one, Xbox 360;Plug and Play Ready
  • 【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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.Support on Ko-Fi

Choose the least disruptive next step

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.