安裝 SQL Server 2005 時發生錯誤:The SQL Server System Configuration Checker cannot be executed due to WMI configuration ...

摘要:安裝 SQL Server 2005 時發生錯誤:The SQL Server System Configuration Checker cannot be executed due to WMI configuration ...

在安裝 SQL Server 2005 時發生錯誤:

The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine ACER370 Error:2147749907 (0x80041013).

用 Google 找了一下,原因主要是因為 Windows Server 2003 更新了某個 patch 之後,造成 WMI 損壞。同時也找到了許多解法,但只有這篇文章提供的方法解決了我的問題:http://blog.joycode.com/uestc95/archive/2005/11/11/66845.aspx

順便把 DOS 指令貼上來:

--------------------------------
@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
----------------------------------

將以上命令存成一個 FIXWMI.CMD 文字檔,然後在 DOS 視窗(命令提示字元)輸入 FIXWMI.CMD 執行就行了。