After a restore from the backup of a server, I found myself fighting a WMI issue.
Whenever I tried to view the dependencies of a service through services.msc I got the error an WMI error. I immediately noticed that the Windows Management Instrumentation service was stopped and when trying to start it I got a cryptic error.
To make an afternoon of troubleshooting short, my solution was the following script:
@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 (*.mof,*.mfl) do Mofcomp %%1
net start winmgmt
goto end
:FixSrv
if /I (%1) == (wbemcntl.exe) goto End
if /I (%1) == (mofcomp.exe) goto End
%1 /RegServer
:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt
:End
This script basically re-registers all *.dll, *.mof and *.mfl files related to the service ![]()

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 