修复 WMI 错误
作者:jit 日期:2009-05-05
rem 将以下内容复制保存到.bat文件里,再执行。
@ECHO ON
REM if not exist %windir%\system32\wbem goto TryInstall
cd /d %windir%\system32\wbem
net stop winmgmt
winmgmt /kill
REM if exist Rep_bak rd Rep_bak /s /q
REM rename Repository Rep_bak
for %%i in (*.dll) do RegSvr32 /S %%i
for %%i in (*.exe) do call :FixSrv %%i
for %%i in (*.mof,*.mfl) do Mofcomp %%i
net start winmgmt
goto End
:FixSrv
if /I (%1) == (wbemcntl.exe) goto SkipSrv
if /I (%1) == (wbemtest.exe) goto SkipSrv
if /I (%1) == (mofcomp.exe) goto SkipSrv
%1 /RegServer
:SkipSrv
goto End
:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt
:End
@ECHO ON
REM if not exist %windir%\system32\wbem goto TryInstall
cd /d %windir%\system32\wbem
net stop winmgmt
winmgmt /kill
REM if exist Rep_bak rd Rep_bak /s /q
REM rename Repository Rep_bak
for %%i in (*.dll) do RegSvr32 /S %%i
for %%i in (*.exe) do call :FixSrv %%i
for %%i in (*.mof,*.mfl) do Mofcomp %%i
net start winmgmt
goto End
:FixSrv
if /I (%1) == (wbemcntl.exe) goto SkipSrv
if /I (%1) == (wbemtest.exe) goto SkipSrv
if /I (%1) == (mofcomp.exe) goto SkipSrv
%1 /RegServer
:SkipSrv
goto End
:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt
:End
[本日志由 jit 于 2009-06-06 05:42 PM 编辑]
上一篇: 批处理命令详解-B
下一篇: 正则表达式30分钟入门教程
文章来自: 本站原创
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论

