WMI Repair

Anonymous
2010-04-22T12:52:17+00:00

Hi, I would like to use a batch file to help me repairing WMI issues.  What other known commands could be added to these lines ? Should I apply this script also for Vista or Win 7 or does the salvagerepository run  similar steps ?


net stop winmgmt

c:

cd %windir%\system32\wbem

rd /S /Q repository

regsvr32 /s %systemroot%\system32\scecli.dll

regsvr32 /s %systemroot%\system32\userenv.dll

mofcomp cimwin32.mof

mofcomp cimwin32.mfl

mofcomp rsop.mof

mofcomp rsop.mfl

for /f %%s in (’dir /b /s *.dll’) do regsvr32 /s %%s

for /f %%s in (’dir /b *.mof’) do mofcomp %%s

for /f %%s in (’dir /b *.mfl’) do mofcomp %%s

mofcomp -n:root\cimv2\applications\exchange wbemcons.mof

mofcomp -n:root\cimv2\applications\exchange smtpcons.mof

mofcomp exmgmt.mof

mofcomp exwmi.mof

net start winmgmt

Windows for home | Previous Windows versions | Devices and drivers

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Anonymous
    2010-04-22T15:41:20+00:00

    The commands above are pretty much everything that I know for troubleshooting WMI.

    In Vista / Win7 there's 2 additional commands that automate some of the above manual commands:

    Winmgmt /verifyrepository

    Winmgmt /salvagerepository

    You first run the verify command and it will tell you if the database is consistent, or inconsistent.  If inconsistent, you run the salvage command and it tries to fix it.

    I suppose you could just jump right to the salvage command in your script, but it's good to know the verify command as well if you are trying to find root cause.

    You might also get some more ideas from the technet forum, as the answers forum is more consumer focused.

    Kevin


    If you find that my answer was what you were looking for, please remember to click the "mark as answer" box below!

    0 comments No comments
  2. Anonymous
    2010-05-04T01:26:00+00:00

    I went here but to no avail. I have an OEM version of Windows 7 64 Bit.

    http://windowsxp.mvps.org/repairwmi.htm

    I went to Google and it said much of nothing regarding WMI and how to fix this glitch.

    Thanks, Donald


    Regards, Donald

    0 comments No comments
  3. Anonymous
    2011-05-13T05:09:06+00:00

    The only way I know of to fix WMI? REPAIR INSTALL

    0 comments No comments
  4. Anonymous
    2011-05-13T08:56:23+00:00

    What is the glitch that the WMI keep getting corrupted and what are they symptoms?

    I think I would figure out the glitch and stop whatever it is and never have to rebuild the WMI in the first place.

    0 comments No comments