Skip to content

Instantly share code, notes, and snippets.

@johngrant
Last active October 6, 2022 18:40
Show Gist options
  • Save johngrant/60d746e370b4049a8d681c13909b0711 to your computer and use it in GitHub Desktop.
Save johngrant/60d746e370b4049a8d681c13909b0711 to your computer and use it in GitHub Desktop.
Reset WMI files. Useful script to get Docker Desktop running again.
REM Turn winmgmt service Startup type to Disabled
sc config winmgmt start = disabled
REM Stop winmgmt service
net stop winmgmt /y
REM Register / Reregister Service DLLs
regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.dll
REM Enter WBEM folder
cd /d %systemroot%\system32\wbem
REM Remove “repository” folder
rd /S /Q repository
REM Register / Reregister Service DLLs
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s
for /f %%s in ('dir /b /s *.exe') do regsvr32 /s %%s
for /f %%s in ('dir /b *.mof') do mofcomp %%s
for /f %%s in ('dir /b *.mfl') do mofcomp %%s
REM Register / Reregister wmiprvse Service
wmiprvse /regserver
REM Register / Reregister winmgmt Service
winmgmt /regserver
REM Enter WBEM folder in SysWOW64
cd /d %systemroot%\SysWOW64\wbem\
REM Remove “repository” folder
rd /S /Q repository
REM Register / Reregister Service DLLs
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s
for /f %%s in ('dir /b /s *.exe') do regsvr32 /s %%s
for /f %%s in ('dir /b *.mof') do mofcomp %%s
for /f %%s in ('dir /b *.mfl') do mofcomp %%s
REM Turn winmgmt service Startup type to Automatic
sc config winmgmt start = auto
REM Stop winmgmt service
net start winmgmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment