SC delete Winmgmt
sc create Winmgmt binPath= "C:\Windows\System32\svchost.exe -k netsvcs" type= share start= auto DisplayName= "Windows Management Instrumentation" group= netsvcs depend= RpcSs
sc description Winmgmt "提供共同的界面和對象模式以便訪問有關操做系統、設備、應用程序和服務的管理信息。若是此服務被終止,多數基於 Windows 的軟件將沒法正常運行。若是此服務被禁用,任何依賴它的服務將沒法啓動。"
服務出現問題,啓動不了,出現「error2,指定文件找不到」 ,解決辦法以下,在wbem目錄下執行命令行:html
for %i in (*.dll) do RegSvr32 -s %i Regsvr32 -s scrcons.exe Regsvr32 -s unsecapp.exe Regsvr32 -s wbemtest.exe Regsvr32 -s WinMgmt.exe Regsvr32 -s WmiApSrv.exe Regsvr32 -s WmiPrvSE.exe
再次啓動wmi服務時,提示服務已經啓動,OK,完成重裝WMI服務。微軟官網解決說明windows
其它問題處理辦法:app
關於WMI服務日誌報錯致使服務停掉的BUG修改批處理腳本以下,保存爲VBS腳本文件:spa
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\subscription") Set obj1 = objWMIService.Get("__EventFilter.Name='BVTFilter'") set obj2set = obj1.Associators_("__FilterToConsumerBinding") set obj3set = obj1.References_("__FilterToConsumerBinding") For each obj2 in obj2set WScript.echo "Deleting the object" WScript.echo obj2.GetObjectText_ obj2.Delete_ next For each obj3 in obj3set WScript.echo "Deleting the object" WScript.echo obj3.GetObjectText_ obj3.Delete_ next WScript.echo "Deleting the object" WScript.echo obj1.GetObjectText_ obj1.Delete_
保存爲Workaround.vbs
右鍵命令提示「command prompt」
單擊開始,程序,右鍵命令行,以管理員運行,執行vbs操作系統
其它解決方法:.net
sfc /scannow
遇到服務沒法啓動的狀況,解決方法命令行
rem open a CMD window (in Win7/Vista open as admin) and type at the cmd prompt: net stop winmgmt rem(choose Y when needed) winmgmt /resetrepository net start winmgmt
@echo on cd /d c:\temp if not exist %windir%\system32\wbem goto TryInstall cd /d %windir%\system32\wbem net stop winmgmt winmgmt /kill if exist Rep_bak rd Rep_bak /s /q 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
sc stop SharedAccess
sc stop iphlpsvc
sc stop wscsvc
參考:https://blog.csdn.net/haiross/article/details/129501753d
https://www.cnblogs.com/Full--Stack/p/8041397.html日誌
https://answers.microsoft.com/en-us/windows/forum/all/wmi/fd22fec4-f5c9-4d83-9373-e7d8063d3e8b