Saturday, 29 September 2012

The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine Error:2147749896 (0×80041008).

A couple of days back I  had my computer formatted. I reinstalled it with Vista SP1 32bit. Subsequent to installing other indispensable software  I tried to install SQL Server 2005 .  However, it instantly displayed the following error message.
The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine Error:2147749896 (0×80041008).
It was a bit frustrating for me as it was pretty late and I ardently wanted to install SQL Server 2008 right after I was done  with installing SQL Server 2005. I pinged my friend James Locazicoski with the above error message. James came to my rescue with a batch file. I immediately ran the batch file on my server;  it took a while and when it was done it closed itself on vista. I kept my fingers crossed and ran my SQL Server installer right after that.   There was no WMI error to wreck my nerve. I was able to successfully install SQL Server right after that.
Well, this bat file is certainly a life savior. While searching online I found this script at several places, which reflects its popularity and usability. I need help from my readers regarding the following information


1) Where is the original source of this script?
2) What is this script actually doing?
Once I receive response to both the above questions, I will post the answers  on my blog with due credit to my readers.

    @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


Vikram Bariya