mysql5.7开机wmi_安装sqlserver出现wmi无法启动

在尝试安装SQL Server时遇到WMI服务无法启动的问题,文章描述了三种尝试解决的方法,包括通过命令行操作、安全模式下重置Repository以及使用PowerShell和.NET代码检查服务状态,但均未能解决问题,寻求高手进一步帮助。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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/11d6d64e-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();

}

}

输出没有异常

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

高手给看看看

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值