Fix ERROR_WMI_INVALID_MOF (0X00001072) – WMI MOF corruption
Your WMI repo hit a bad MOF file. We'll rebuild it with a built-in tool. This usually happens after a failed driver install or a botched Windows update.
This error is a pain – but you can fix it in under 10 minutes
You're getting ERROR_WMI_INVALID_MOF (0X00001072) and it's probably stopping a driver install, a script, or a monitoring tool from working. The message reads "The WMI Managed Object Format (MOF) information is not valid." Let's get that sorted.
First fix: Rebuild the WMI repository
This is the real fix in about 90% of cases. Don't mess with individual MOF files – that's a rabbit hole. Instead, we'll reset the entire WMI store using a built-in Windows tool called winmgmt.
Step-by-step
- Open an elevated Command Prompt. Click Start, type "cmd", right-click "Command Prompt", and choose "Run as administrator". Click Yes on the UAC prompt.
- Stop the WMI service. Type this and press Enter:
You should see "The Windows Management Instrumentation service is stopping" and then "stopped successfully."net stop winmgmt - Rename the repository folder (don't delete it yet – we'll keep a backup):
After this, you'll see no confirmation, but the folder is now renamed.ren %windir%\System32\wbem\repository repository.old - Restart the WMI service – this forces Windows to create a fresh repository:
The service should start, and you'll see "The Windows Management Instrumentation service was started successfully."net start winmgmt - Recompile the core MOF files. Still in the elevated CMD, run:
This command will take a minute or two. You'll see lines like "MOF file has been successfully compiled" for each one. If any fail, note the filename.cd /d %windir%\System32\wbem for %i in (*.mof *.mfl) do mofcomp %i - Reboot your machine. A restart locks in the changes and ensures all WMI-dependent services pick up the new repo.
Why this works
The WMI repository lives in C:\Windows\System32\wbem\repository. It's a database of all WMI class definitions, instances, and MOF files. When a driver or update installs a malformed MOF, it corrupts parts of this database. By nuking the repo and recompiling every MOF from the original Windows files, you get a clean slate. The mofcomp step is critical – without it, your fresh repo is empty and nothing WMI-related works.
When that doesn't work – check for a specific bad MOF
Sometimes the generic rebuild fails because a particular MOF file is so broken that mofcomp chokes on it. You'll see an error like "MOF compiler error: 0x80041003" or similar. Here's how to narrow it down:
- Open Event Viewer (type
eventvwr.mscin Run). Go to Windows Logs > System. - Look for events with Source WinMgmt and ID 10 or 63. They often contain the path to the bad MOF file, like
C:\Windows\System32\wbem\Snmp.mof. - Once you have the exact filename, temporarily move it out of the
wbemfolder:
Then run the repository rebuild steps again. If the error disappears, you've found the culprit. You can try to replace that MOF from a healthy machine (same Windows version, same build).move C:\Windows\System32\wbem\Snmp.mof C:\Windows\System32\wbem\Snmp.bad
Less common causes – hardware driver nightmares
I've seen this error pop up after installing certain network card drivers (especially Realtek and Broadcom) or GPU drivers (NVIDIA Studio drivers, not Game Ready). If the rebuild works for a day and then the error returns, a driver is re-introducing the bad MOF. In that case:
- Roll back the last driver you installed via Device Manager (right-click device > Properties > Driver > Roll Back Driver).
- Or uninstall the device completely, reboot, and let Windows reinstall the driver from Windows Update. Microsoft's signed drivers are usually cleaner than OEM custom ones.
Another weird one: third-party security software (especially older versions of McAfee or Symantec) inject their own WMI providers. A corrupted update there can trigger 0X00001072. Temporarily disable or uninstall the security suite to test.
Prevention – keep it from coming back
- Always run Windows Update – Microsoft fixes MOF-related bugs in cumulative updates. I've seen KB5021233 and later patches include WMI stability fixes.
- Stick to driver versions from Windows Update or the hardware vendor's certified page. Avoid beta drivers.
- Before installing a major update (like a feature update to Windows 11 23H2), run
winmgmt /verifyrepositoryto check health. If it returns "WMI repository is consistent", you're good. - If you manage servers, set up a monthly task to run
winmgmt /salvagerepository– this repairs minor corruption without a full rebuild.
That's it. You fixed the error, you know why it happened, and you can stop it from coming back. If you're still stuck, check the Event Viewer logs for a specific MOF path and come back to the section above – that's your next move.
Was this solution helpful?