Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

As a part of a larger C# code base, I've been running the following query regularly on the same machine (Windows XP SP2):

"SELECT * from Win32_Process"

It's been working as expected until today. Now, the query hangs indefinitely without returning any results. I've tried querying several other WMI Provider classes on this machine, and they work as expected.

I rebooted the machine, but that didn't help. I checked the Application event log, where WMI reports errors, but there are no clues there. I've also tried two other methods of enumerating the Win32_Process instances : a VBscript, and WMI CIM Studio. Both hang in the same way.

I tried running WMIDiag.vbs, a diagnostic script provided by Microsoft. However, it hangs indefinitely during the step called "Verifying WMI Providers loaded BEFORE WMIDiag execution." The documentation does say the script can take up to 6 hours to run, but it's been hung at 0% CPU usage for more than 12 hours now.

I'm at a loss here. Can anybody suggest why a single the Win32_Process class might cease working, while the rest of the WMI classes are behaving as usual? I would strongly prefer to fix this issue specifically, rather than throwing up my hands and wiping the machine.

If there is any extra system information that would be useful, please let me know. I don't have a clue where to proceed next with the troubleshooting process.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

WMI might have gotten corrupt on that machine. Try reinstalling it.

COPY ALL LINES BELOW INTO A BATCH FILE AND RUN IT:

net stop winmgmt

pause

c:

cd c:\windows\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 exwmi.mof

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

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

mofcomp exmgmt.mof
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.