I had a problem with my Microsoft SQL Server 2008, importing data and generating scripts, so I decided to uninstall it. When I tried to remove it, I got an error from the check screen. The WMI service is corrupted, so I need a way to reset the WMI service.

Platform: Windows 7 64bit

I did try winmgmt /resetrepository

to no effect.

Short of reinstalling Windows, what can I do?


5 Answers 5


If its a file level corruption you could probably try the sfc /scannow command - this will check and replace any system files that are damaged.


To fully rebuild the WMI Repository follow these steps:

  1. Disable and stop the winmgmt service.
  2. Remove or rename C:\Windows\System32\wbem\repository.
  3. Enable and start the winmgmt service.
  4. Open a cmd prompt as Administrator.
  5. In the cmd prompt navigate to C:\Windows\System32\wbem\
  6. Run the command for /f %s in ('dir /b *.mof') do mofcomp %s This will take a minute or so to complete.
  7. Run the command for /f %s in ('dir /b en-us\*.mfl') do mofcomp en-us\%s

I had the same problem and using Repair WMI from Tweaking.com fixed it.

  • The tool mentioned in this answer fixed the issue for me & as a bonus got the question re-opened.
    – AStopher
    Jan 10, 2015 at 15:18

Another handy option to fix WMI using a WMI Fixer Tool (WMI Fixer.ps1) created by Guido Basilio de Oliviera and is freely available.

This tool is based on Windows Powershell and Windows Forms:

cd /d % windir% \System32\Wbem
net stop winmgmt

winmgmt /clearadap
winmgmt /kill
winmgmt /unregserver
winmgmt /regserver
winmgmt /resyncperf

del % windir% \System32\Wbem\Repository /Q
del % windir% \System32\Wbem\AutoRecover /Q

for % % i in (* .dll) do Regsvr32 -s % % i
for % % i in (* .mof, * .mfl) do Mofcomp % % i
wmiadap.exe /Regsvr32
wmiapsrv.exe /Regsvr32
wmiprvse.exe /Regsvr32

net start winmgmt

Or alternatively..

  • Disable and stop the WMI service.       
  • Run the following commands.     

    Winmgmt /salvagerepository %windir%\System32\wbem


    Winmgmt /resetrepository %windir%\System32\wbem


  • Re-enable the WMI service and then reboot the PC to see how it goes.

         You could also try rebuilding the repository if the above fails:

  • Disable and stop the WMI service.


  • Rename the repository folder (located at %windir%\System32\wbem\repository) to repository.old.

  • Re-enable the WMI service.


  • Reboot the PC


  1. WMI corrupt - how to reinstall/repair?

I run into corrupt WMI fairly often working with client systems. I was very frustrated by the acknowledgement from MS that WMI has issues and not getting releif with any suggested fix.

Last year I found this procedure and it works EVERY TIME!

Open a Microsoft PowerShell window. Type the following commands and press enter after each command

net stop winmgmt
ren c:\windows\system32\wbem\repository  c:\windows\system32\wbem\repository_old
net start winmgmt 
cd c:\windows\system32\wbem
lodctr /r 

Check and make sure all services are running.  A reboot is not required at this point, but it is the fastest way to assure that all services restart.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .