Repairing WMI Repository
When troubleshooting WMI on SMS/SCCM clients, I’ve frequently used the following command to attempt a repair of the WMI repository. I don’t recall where I found it (several years ago), but I also don’t want to ever forget it!
- Open a command prompt
- Change to directory C:\Windows\system32\wbem\
- Run: for /f %s in (‘dir /b *.mof *.mfl’) do mofcomp %s
June 3, 2013 at 9:16 pm
Thanks very much for taking the time to post this, resolved my issue. “MSI: Setup was unable to create the WMI namespace CCM.The error code is 80040154”
June 4, 2013 at 9:01 am
Cool!
July 7, 2016 at 7:29 am
what is ‘dir. I am getting the below error. Please advise me
C:\Windows\System32\wbem>for /f %s in (`dir /b *.mof *.mfl’) do mofcomp %s
The system cannot find the file `dir.
July 10, 2016 at 3:47 pm
It’s a bad textual copy is all. In your comment I already spot that the leading quote mark (‘) is using what’s called a “smart quote” where it’s slanted. I’ll fix on my post, but just type in the command directly, it’ll work.
October 24, 2018 at 12:09 pm
for /f %s in (‘dir /b *.mof *.mfl’) do mofcomp %s
‘ instead of ´