视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
安装sqlserver出现wmi无法启动
2020-11-09 07:42:10 责编:小采
文档


WmiServiceStateCheck 检查 WMI 服务是否已在计算机上启动并正在运行。 失败 无法启动 Windows Management Instrumentation (WMI)服务。若要继续安装,必须找到问题并修复 Windows Management Instrumentation (WMI)服务。 错误如上 可以正常停止和启动、包

WmiServiceStateCheck 检查 WMI 服务是否已在计算机上启动并正在运行。 失败 无法启动 Windows Management Instrumentation (WMI)服务。若要继续安装,必须找到问题并修复 Windows Management Instrumentation (WMI)服务。

错误如上

可以正常停止和启动、包括重新启动 都是正常的 重置

google了下

第一种办法:

执行下边的脚本无用:

@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

没有报错

第二种办法:用这里的办法也没用

http://social.technet.microsoft.com/Forums/en-US/itprovistasetup/thread/11d6de-543b-40cd-a0f6-ba97c3806fbb/

1) Start the computer and press F8 on boot up and select Safe Mode.
2) In the start menu type "cmd" (without quotes) and on the top search result, right click the program icon and choose Run as administrator
3) Type "net stop winmgmt" (without quotes) and press Enter to make certain the WindowsManagementInstrumentation (WMI) service is not running.
4) Open a Windows Explorer and locate the path to C:\ windows\system32\WBEM\ folder and rename the Repository folder to something else like RepositoryOLD (right click and choose 'Rename Folder').
5) Reboot and restart as normal.
6) In the start menu type "cmd" (without quotes) and on the top search result, right click the icon and choose Run as administrator
7) Type "net stop winmgmt" (without quotes) and press enter to stop the WMI service.
8) Type "winmgmt /resetRepository" (without quotes) and restart the computer.

每一步都提示成功的 最后一步是 重置成功 然后重启计算机 运行sql安装程序还是这个错误

第三种办法:
参考:https://connect.microsoft.com/SQLServer/feedback/details/682543/wmi-service-cannot-be-started-when-installing-sql-server-denali-ctp3

SELECT NAME FROM WIN32_SERVICE WHERE NAME = 'winmgmt'

Win32_Service.Name='winmgmt'

跟这位的错误时一样的 包括 运行powershell

PS C:\Windows\System32\wbem> get-wmiobject -Query "SELECT NAME FROM WIN32_SERVICE WHERE NAME = 'winmgmt'"
Get-WmiObject : 未将对象引用设置到对象的实例。
所在位置 行:1 字符: 14
+ get-wmiobject <<<< -Query "SELECT NAME FROM WIN32_SERVICE WHERE NAME = 'winmgmt'"
+ CategoryInfo : NotSpecified: (:) [Get-WmiObject], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

我运代码 2.0 3.5 4.0 都是正确的下边的代码:

using System;
using System.Management;

public class Sample
{
public static void Main()
{
ManagementClass c = new ManagementClass("Win32_Process");
foreach (ManagementObject o in c.GetInstances())
Console.WriteLine(
"Next instance of Win32_Process : {0}", o["Name"]);

Console.ReadKey();

}
}

输出没有异常

-------------看那位后边似乎是重装系统搞定的

高手给看看看

下载本文
显示全文
专题