Hi,
You can run the following commands in an elevated command prompt. It recompiles all the built-in WMI provider MOF files and re-register the WMI provider DLLs.
- Stop the WMI service and set it to disabled:
sc config winmgmt start= disabled net stop winmgmt /y
- Navigate to the WBEM folder:
%systemdrive%
- Re-register the WMI providers:
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
- Set the WMI service back to Auto and start the service:
sc config winmgmt start= Auto net start winmgmt
- Recompile the MOF files:
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s
Please note that this sets the WMI repository back to its initial state when the operating system was installed. WMI will lose all the information that was gathered over time about the system itself, applications, services, and other entities around it.
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.