Skip to content

Instantly share code, notes, and snippets.

@p0rkjello
Created May 30, 2017 18:39
Show Gist options
  • Save p0rkjello/3a0a9f64fac3bc3aa9bdfabdad64d10a to your computer and use it in GitHub Desktop.
Save p0rkjello/3a0a9f64fac3bc3aa9bdfabdad64d10a to your computer and use it in GitHub Desktop.
Reregister WMI DLL's and rebuild MOF files.
:: https://blogs.technet.microsoft.com/askperf/2009/04/13/wmi-rebuilding-the-wmi-repository/
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment