MISC.‎ > ‎

Fix WMI

This is a Collection of Actions that I found to be helpful with all kinds of WMI Problems.

This Batch will not resolve every WMI Problem there is but most of the simple problems.
The Batch will fix problems like:
  • WMI: Provider Load Failure
  • WMI Permissions Errors
  • Unable to connect to WMI service '\root\cimv2'
  • WMI information may be corrupted
The Batch Performs the following actions:
  1. Stops The WMI Service
  2. Resets the WMI Permissions to Default
  3. Imports a Registry File that contains the WBEM Default Properties (save this file in the Windows Folder)
  4. Using the WMI Managment Tool
    1. Clear WMI Adapter
    2. Kill any Opened WMI Processes
    3. Unregister the WMI Server
    4. Re-Register the WMI Server
    5. Re-Sync the WMI Perf. Files
  5. Delete all the Repository File from the Repository Directory
  6. Delete all the MOF Files from the Autorecover Directory
  7. Re-Register all the DLL Files of WMI
  8. Re-Complie, using MOFComp, all the MOF Files
  9. Re-Register the WMI Adapter
  10. Re-Register the WMI Application Server
  11. Re-Register the WMI Service Provider
  12. Start the WMI Service
After running this Batch most of your WMI Problems will (hopefully) be solved :)





cd /d %windir%\System32\Wbem
net stop winmgmt

sc sdset winmgmt D:(A;;CCDCLCSWRPWPDTLOCRRC;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DA)(A;;CCDCLCSWRPWPDTLOCRRC;;;PU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)

REM REG IMPORT %windir%\WBEM.reg

winmgmt /clearadap
winmgmt /kill
winmgmt /unregserver
winmgmt /regserver
winmgmt /resyncperf

del %windir%\System32\Wbem\Repository /Q
del %windir%\System32\Wbem\AutoRecover /Q

for %%i in (*.dll) do Regsvr32 -s %%i
for %%i in (*.mof,*.mfl) do Mofcomp %%i
wmiadap.exe /Regsvr32
wmiapsrv.exe /Regsvr32
wmiprvse.exe /Regsvr32

net start winmgmt
Comments