WMI Repair

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

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!
I'm a PC!

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

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
DonB

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

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

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

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.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated January 7, 2025 Views 11,611 Applies to: