安装sqlserver出现wmi无法启动
WmiServiceStateCheck 检查 WMI 服务是否已在计算机上启动并正在运行。 失败 无法启动 Windows Management Instrumentation (WMI)服务。若要继续安装,必须找到问题并修复 Windows Management Instrumentation (WMI)服务。 错误如上 可以正常停止和启动、包
WmiServiceStateCheck | 检查 WMI 服务是否已在计算机上启动并正在运行。 | 失败 | 无法启动 Windows Management Instrumentation (WMI)服务。若要继续安装,必须找到问题并修复 Windows Management Instrumentation (WMI)服务。 |
错误如上
可以正常停止和启动、包括重新启动 都是正常的 重置
google了下
第一种办法:
执行下边的脚本无用:
@echo on <br>cd /d c:\temp <br><span>if</span> not exist %windir%\system32\wbem <span>goto</span> TryInstall <br>cd /d %windir%\system32\wbem <br>net stop winmgmt <br>winmgmt /kill <br><span>if</span> exist Rep_bak rd Rep_bak /s /q <br>rename Repository Rep_bak <br><span>for</span> %%i <span>in</span> (*.dll) <span>do</span> RegSvr32 -s %%i <br><span>for</span> %%i <span>in</span> (*.exe) <span>do</span> call :FixSrv %%i <br><span>for</span> %%i <span>in</span> (*.mof,*.mfl) <span>do</span> Mofcomp %%i <br>net start winmgmt <br><span>goto</span> End <br><br>:FixSrv <br><span>if</span> /I (%<span>1</span>) == (wbemcntl.exe) <span>goto</span> SkipSrv <br><span>if</span> /I (%<span>1</span>) == (wbemtest.exe) <span>goto</span> SkipSrv <br><span>if</span> /I (%<span>1</span>) == (mofcomp.exe) <span>goto</span> SkipSrv <br>%<span>1</span> /RegServer <br><br>:SkipSrv <br><span>goto</span> End <br><br>:TryInstall <br><span>if</span> not exist wmicore.exe <span>goto</span> End <br>wmicore /s <br>net start winmgmt <br>:End
没有报错
第二种办法:用这里的办法也没用
http://social.technet.microsoft.com/Forums/en-US/itprovistasetup/thread/11d6d64e-543b-40cd-a0f6-ba97c3806fbb/<br><br>
<span>1</span>) Start the computer and press F8 on boot up and <span>select</span> Safe Mode.<br><span>2</span>) In the start menu type <span>"</span><span>cmd</span><span>"</span> (without quotes) and on the top search result, right click the program icon and choose Run <span>as</span> administrator<br><span>3</span>) Type <span>"</span><span>net stop winmgmt</span><span>"</span> (without quotes) and press Enter to make certain the WindowsManagementInstrumentation (WMI) service <span>is</span> not running.<br><span>4</span>) Open a Windows Explorer and locate the path to C:\ windows\system32\WBEM\ folder and rename the Repository folder to something <span>else</span> like RepositoryOLD (right click and choose <span>'</span><span>Rename Folder</span><span>'</span>).<br><span>5</span>) Reboot and restart <span>as</span> normal.<br><span>6</span>) In the start menu type <span>"</span><span>cmd</span><span>"</span> (without quotes) and on the top search result, right click the icon and choose Run <span>as</span> administrator<br><span>7</span>) Type <span>"</span><span>net stop winmgmt</span><span>"</span> (without quotes) and press enter to stop the WMI service.<br><span>8</span>) Type <span>"</span><span>winmgmt /resetRepository</span><span>"</span> (without quotes) and restart the computer.
<br><br>
每一步都提示成功的 最后一步是 重置成功 然后重启计算机 运行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=<span data-mce-="">'</span><span data-mce-="">winmgmt</span><span data-mce-="">'</span>
跟这位的错误时一样的 包括 运行powershell
PS C:\Windows\System32\wbem> get-wmiobject -Query <span>"</span><span>SELECT NAME FROM WIN32_SERVICE WHERE NAME = 'winmgmt'</span><span>"</span><br>Get-WmiObject : 未将对象引用设置到对象的实例。<br>所在位置 行:1 字符: 14<br>+ get-wmiobject "<span>SELECT NAME FROM WIN32_SERVICE WHERE NAME = 'winmgmt'</span><span>"</span><br> + CategoryInfo : NotSpecified: (:) [Get-WmiObject], NullReferenceException<br> + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
<br><br>
<br><br>
我运代码 2.0 3.5 4.0 都是正确的下边的代码:
using System;
using System.Management;<br><br>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"]);<br><br> Console.ReadKey();<br><br> }
}
<br><br>
输出没有异常
-------------看那位后边似乎是重装系统搞定的
高手给看看看

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The import steps are as follows: Copy the MDF file to SQL Server's data directory (usually C:\Program Files\Microsoft SQL Server\MSSQL\DATA). In SQL Server Management Studio (SSMS), open the database and select Attach. Click the Add button and select the MDF file. Confirm the database name and click the OK button.

For objects with the same name that already exist in the SQL Server database, the following steps need to be taken: Confirm the object type (table, view, stored procedure). IF NOT EXISTS can be used to skip creation if the object is empty. If the object has data, use a different name or modify the structure. Use DROP to delete existing objects (use caution, backup recommended). Check for schema changes to make sure there are no references to deleted or renamed objects.

To view the SQL Server port number: Open SSMS and connect to the server. Find the server name in Object Explorer, right-click it and select Properties. In the Connection tab, view the TCP Port field.

When the SQL Server service fails to start, here are some steps to resolve: Check the error log to determine the root cause. Make sure the service account has permission to start the service. Check whether dependency services are running. Disable antivirus software. Repair SQL Server installation. If the repair does not work, reinstall SQL Server.

If you accidentally delete a SQL Server database, you can take the following steps to recover: stop database activity; back up log files; check database logs; recovery options: restore from backup; restore from transaction log; use DBCC CHECKDB; use third-party tools. Please back up your database regularly and enable transaction logging to prevent data loss.

SQL Server database files are usually stored in the following default location: Windows: C:\Program Files\Microsoft SQL Server\MSSQL\DATALinux: /var/opt/mssql/data The database file location can be customized by modifying the database file path setting.

If the SQL Server installation fails, you can clean it up by following these steps: Uninstall SQL Server Delete registry keys Delete files and folders Restart the computer

SQL Server English installation can be changed to Chinese by following the following steps: download the corresponding language pack; stop the SQL Server service; install the language pack; change the instance language; change the user interface language; restart the application.
