Configure and troubleshoot Windows Management Instrumentation

23 July 2000 by Snakefoot | Comment » | Trackback Off
Windows Management Instrumentation (WMI) will fail to start or operate properly if the WMI repository is corrupt. Depending on what version of Windows, there are different ways to repair/rebuild/reset the WMI repository:
  • Windows Vista/2008:

    winmgmt /verifyrepository
    winmgmt /salvagerepository

  • Windows XP (Requires atleast SP2):

    rundll32 wbemupgd, UpgradeRepository

  • Windows 2003 (Requires atleast SP1):

    rundll32 wbemupgd, RepairWMISetup

  • Other versions (Note it will reset the ICS and ICF configuration):
    1. winmgmt /clearadap
    2. winmgmt /kill
    3. winmgmt /unregserver
    4. winmgmt /regserver
    5. winmgmt /resyncperf
    6. net stop winmgmt
    7. del %windir%\system32\Wbem\Repository\*.* /s
    8. net start winmgmt
    9. %windir%\system32\wbem\wbemtest.exe
More Info MS Technet - WMI Isn't Working!
More Info MS KB Q216738
More Info MS KB Q266416
More Info MS KB Q305992
More Info MS KB Q823775 (Replaces Q319101)
More Info MS KB Q875605

Note if for some obscure reason wanting to disable the WMI service, then WinMgmt.exe will complain, this can be solved by running these commands before disabling:

winmgmt /clearadap
winmgmt /kill
winmgmt /unregserver

To see all parameters for WinMgmt.exe :

winmgmt /?

Updated: 14 July 2008

Comments:

Comment by Tim Ewald - 30 January 2008 @ 18:07 Reply

Great information! Saved me a lot of hair pulling. Thanks!

Comment by badr - 6 February 2008 @ 19:44 Reply

thank you soo much that was soo helpfull . you are the master :)

Comment by Torii Tom - 21 February 2008 @ 22:17 Reply

The first command (rundll32 wbemupgd, UpgradeRepository) worked on my PC; thank you very much.

Comment by Qiss - 2 March 2008 @ 21:14 Reply

Great Great Great !!!
(rundll32 wbemupgd, UpgradeRepository) worked for me, (i typed it in the RUN console in the START menu, if your reading this and wondering where to type it.)
Thx alot man, great site and great work….more power to you….cheers again and take it easy.

Comment by SHERIFF - 3 April 2008 @ 11:39 Reply

Big thnx!
It working!!!

Comment by Hydra - 12 August 2008 @ 13:44 Reply

You are a genius! I’ve been hunting for days to find this fix and the first thing I’ve tried on your site did it. Absolutely the best!

Comment by bilal - 9 July 2009 @ 3:06 Reply

yes. this is exactly what i needed thanks

Comment by Hans - 21 October 2009 @ 2:39 Reply

“Die Eigenschaften der Verbindung können nicht angezeigt werden.”….
This solved it.

Comment by KevinG IT Asst - 24 March 2010 @ 18:31 Reply

After searching for 2 hours I found your info. W2k8 Svr St. So simple winmgmt /salvagerepository fixed my WMI and GPO event log related issues. ThanX

Comment by Steph - 14 February 2011 @ 14:54 Reply

Wonderful - thanks so much!!!!

Comment by Ryan - 30 August 2011 @ 19:51 Reply

Should add this for Win 7:

winmgmt /resetrepository

Comment by Akos - 12 July 2012 @ 17:37 Reply

I was close to jumping out of the window(s ™). But my XP SP2 revived WMI after following your instructions

Thanks a lot.

Comment by Anon - 28 August 2012 @ 19:53 Reply

You are worth your weight in gold. This fixed the following for me:
* programs failing to install with an error of failing to connect to Windows Installer
* unable to connect to WMI Tester
* When checking Dependencies tab in Services had some error about service dependencies interface class not registered.

Comment by Anon - 28 August 2012 @ 22:23 Reply

I also found this script useful as found here:
http://jeffwouters.nl/index.php/2011/04/wmi-error-when-viewing-dependencies-of-services/

@echo on
cd /d c:\temp
if not exist %windir%\system32\wbem goto TryInstall
cd /d %windir%\system32\wbem
net stop winmgmt
winmgmt /kill
if exist Rep_bak rd Rep_bak /s /q
rename Repository Rep_bak
for %%i in (*.dll) do regsvr32 -s %%i
for %%i in (*.mof,*.mfl) do Mofcomp %%1
net start winmgmt
goto end

:FixSrv
if /I (%1) == (wbemcntl.exe) goto End
if /I (%1) == (mofcomp.exe) goto End
%1 /RegServer

:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt
:End

This script basically re-registers all *.dll, *.mof and *.mfl files related to the service

However I needed to change this line from:
for %%i in (*.mof,*.mfl) do Mofcomp %%1
to:
for %%i in (*.mof,*.mfl) do Mofcomp %%i
^ Changed the number 1 to a letter i.

Comment by Devulsky - 2 October 2012 @ 8:39 Reply

Thank you! Repair/rebuild/reset the WMI repository works. Now my Windows 7 is not freezen anymore.

Comment by Tonimoroni - 1 February 2013 @ 19:34 Reply

Took me all day to find you, but so worth it.

I just cut and pasted this - rundll32 wbemupgd, UpgradeRepository - into Run box and WMI was restored in XP.

Thank you so much!

Comment by Rick K - 4 February 2013 @ 4:28 Reply

Did the trick. Saved me from crazy and going thru a lot of crap.

Much Appreciated

Leave a comment


NB! Use the Forum for computer help and off-topic questions.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>