Fix WMI Errors
0 Votes |
Description
Created By: Martin Carnegie
Created: Nov 5, 2013
Comments:
NOTE: Please do testing of this fixlet before using in production as this could cause further issues with WMI!
This script contains two actions that can be used to fix WMI errors on Windows systems.
WMI Simple should be the first one used as it does not impact the system that much and seems to fix most issues.
WMI Advanced should only be used if the WMI Simple does not fix the issue. This will require a reboot
Both wmi_simple and wmi_advanced were provided from a source at Microsoft, but I am unable to find that source.
Property Details
3652 | |
Beta - Preliminary testing ready for more | |
Fix WMI Errors | |
BESC | |
Troubleshooting | |
0 | |
martin@zaazee.ca | |
Repair WMI on Windows systems | |
11/5/2013 12:00:00 AM | |
Repair WMI Windows | |
thetick on 11/5/2013 11:30:33 AM | |
thetick on 1/20/2015 7:32:55 AM | |
8391 Views / 32 Downloads | |
![]() ![]() ![]() ![]() ![]() |
Relevance

Actions
Action 1 (default)
// WMI Simple
delete __creatfile
delete wmi_simple.bat
createfile until __END
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /resyncperf
winmgmt /salvagerepository
for /f %%s in ('dir /b *.mof *.mfl') do mofcomp %%s
__END
copy __createfile wmi_simple.bat
waithidden cmd.exe /c wmi_simple.bat > {value of variable "temp" of environment}\wmi_simple.log 2>&1
This action will be considered successful when the applicability relevance evaluates to false.
Action 2
// WMI Advanced
delete __creatfile
delete wmi_advanced.bat
createfile until __END
net stop winmgmt
c:
cd %systemroot%\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
echo DONE - you must reboot
__END
copy __createfile wmi_advanced.bat
waithidden cmd.exe /c wmi_advanced.bat > {value of variable "temp" of environment}\wmi_advanced.log 2>&1
//According to the MS script, the system should be restarted after the script is executed.
action requires restart
This action will be considered successful when the applicability relevance evaluates to false.
Sharing
Social Media: |
Comments
![]() |
|
With the relevance I put in here, it should only be relevant to systems that have an issue with WMI. If you are looking for the specific errors, you could do this with a web report. I created a blog on this that has the information for the web report (pretty simple). http://blog.gulfsoft.com/2013/11/repairing-wmi-errors-on-windows-systems.html Hope that answers your question. |
![]() |
|
Is there a good way to know that WMI may have errors that require fixing? |