Thursday, September 7, 2017

Batch file to repair the WMI for SCCM client


Below is the batch file to repair the WMI for SCCM client


net stop ccmexec /y

if not exist c:\windows\syswow64 goto x86
If exist c:\windows\syswow64 GOTO x64

:x86
cd /d %windir%\System32\Wbem
net stop winmgmt /y

REM REG IMPORT %windir%\WBEM.reg

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

del %windir%\System32\Wbem\Repository /Q
echo
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

net start ccmexec

:x64
cd /d %windir%\Syswow64\Wbem
winmgmt /salvagerepository
net stop winmgmt /y

REM REG IMPORT %windir%\WBEM.reg

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

del %windir%\System32\Wbem\Repository /Q
echo
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

net start ccmexec

No comments:

Post a Comment

SCCM Application Deployment Tool

SCCM Application Deployment Tool Streamlining SCCM Application Deployments: Introducing the SCCM Application Deployment Tool. In the realm o...