Svchost.exe Sucks CPU and Rebulding the WMI/WBEM Repository
Lately I've been seeing one particular svchost.exe sucking CPU. There always a number of in-proc running inside of each of the many svchost (Service Host) instances. Using ProcEx, I figured out the PID of the specific instance. Then, I right clicked within ProcEx, hit Properties, and under the Threads tab noticed that wbemcore.dll was working REALLY hard.
Crap, time to re-schmutz WMI's repository. So, I stop WMI from the command line with :
net stop winmgmt
Then I deleted the Repository directory in c:\windows\system32\wbem\ then started again with
net start winmgmt
Then I re-stored/compiled all the .mof (Managed Object Format) files with a batch file containing this one line:
for %%i in (*.mof,*.mfl) do Mofcomp.exe %%i
Now I'm back in business.