I am trying to restore the HP Namespace in WMI. Since I do not know the specific MOF file(s) involved, I am using a hammer to recompile all MOFs and register all dlls in c:\windows\system32\wbem. This script works when I run it manually line-by-line from an administrative command prompt, but running via a Bigfix fixlet does not work.
delete wmifix.bat
delete __createfile
createfile until end
@ECHO OFF
sc config winmgmt start= disabled
net stop winmgmt /y
timeout /T 10
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s
end
move __createfile wmifix.bat
waithidden wmifix.bat