首页  编辑  

重建WMI数据库

Tags: /计算机文档/Windows应用技巧/   Date Created:
如果需要重建WMI数据库,可以运行以下指令:
  • Windows server 2008
sc config winmgmt start= disabled
net stop winmgmt /y
cd %windir%\system32\wbem
rename repository repository.old
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 /b *.mof *.mfl') do mofcomp %s
  • Windows Server 2012 及以后版本
右击 cmd,选择以管理员身份运行,运行以下命令行:
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
ren repository repository-backup
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
sc config winmgmt start= Auto
net start winmgmt
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in