My development environment failed the prerequisite of SQL Server Express R2 Edition numerous time. It had passed all the requirements expect the Windows Management Instrumentation. It shows that the service is either not running or failed to start. At first, tried manually rebooting the service from the administration tools and re-run the prerequisite but still failed. Even rebooted the computer few times but still the same error persist.
After going through several online source, I came up with three different solution to fix the issue. Refer to the solution below. It may not work for everyone and depends on the OS version too.
Method 3 : Batch File
Copy the code below into notepad and save it as .bat file. Run the file as administrator on your machine. It will take few minutes to completes its task. Once the batch file proccessing complete, reboot the system and install the SQL Server Express R2 Edition.
The code was taken from an online source and it worked for me. I am using Windows 7 Ultimate.
net stop winmgmt c: cd %systemroot%\system32\wbem rd /S /Q repository regsvr32 /s %systemroot%\system32\scecli.dll regsvr32 /s %systemroot%\system32\userenv.dll mofcomp cimwin32.mof mofcomp cimwin32.mfl mofcomp rsop.mof mofcomp rsop.mfl for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s for /f %%s in ('dir /b *.mof') do mofcomp %%s for /f %%s in ('dir /b *.mfl') do mofcomp %%s echo DONE reboot pause
Method 2 : System Restore
This is yet another method suggested by several experts. By restoring the system to an earlier stage the issue can be fixed. Many user said the following method worked most of the time. However it may also make changes to other parts of the machine. Please make sure you have all the neccesary backups before running the system restore. In case anything goes wrong, backups would become handy.
Method 1 : Formatting
Formatting could be the last option, if all the above method failed. Backup all your files, format your machine and install the SQL Server Express R2 Edition.
Hope it helps. If there are any other method or ways to fix the Windows Management Instrumentation error , please do share it with us. Thanks