BigSea'Blog

身体下地狱,眼睛上天堂,心灵回故乡。走在路上,那是痛苦的幸福;走过之后,是幸福的痛苦。

修复系统WMI组件

No Comments | 安全技术 | by bigsea | 3596 Views. | 2007, September 19, 8:46 AM

 

在使用sfu过程中曾经做过次优化,今天在使用的过程中发现SFU的管理工具无法使用,提示无法使用wmi组件

在网络上找了个修复的方法,以及源代码

忘记出处在什么地方了,感谢原作者

在使用前愿意的可以了解下什么是WMI

http://www.microsoft.com/china/MSDN/library/enterprisedevelopment/softwaredev/WDdnclinicscripting.mspx?mfr=true

把下面代码保存为xxx.bat格式运行即可修复,希望可以帮助到遇到跟我同样情况的兄弟

XML/HTML代码
  1. ===============================   
  2. FIXWMI.CMD    
  3. ------------------------    
  4.   
  5. @echo on    
  6. cd /d c:\temp    
  7. if not exist %windir%\system32\wbem goto TryInstall    
  8. cd /d %windir%\system32\wbem    
  9. net stop winmgmt    
  10. winmgmt /kill    
  11. if exist Rep_bak rd Rep_bak /s /q    
  12. rename Repository Rep_bak    
  13. for %%i in (*.dll) do RegSvr32 -s %%i    
  14. for %%i in (*.exe) do call :FixSrv %%i    
  15. for %%i in (*.mof,*.mfl) do Mofcomp %%i    
  16. net start winmgmt    
  17. goto End    
  18.   
  19. :FixSrv    
  20. if /I (%1) == (wbemcntl.exe) goto SkipSrv    
  21. if /I (%1) == (wbemtest.exe) goto SkipSrv    
  22. if /I (%1) == (mofcomp.exe) goto SkipSrv    
  23. %1 /RegServer    
  24.   
  25. :SkipSrv    
  26. goto End    
  27.   
  28. :TryInstall    
  29. if not exist wmicore.exe goto End    
  30. wmicore /s    
  31. net start winmgmt    
  32. :End    
  33.   
  34.   
  35. ========   

上一篇: 【安邦观察】国内“股地拉扯”的局面已经完全形成
下一篇: 我们对这个世界了解多少--推荐影片<百慕大之夜>