01 Apr 2011 @ 12:14 PM 

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 Smile

Post to Twitter

Posted By: Jeff Wouters
Last Edit: 01 Apr 2011 @ 12:14 PM

EmailPermalinkComments (4)
Tags
Tags: , , , ,
Categories: Microsoft, Windows

Get Adobe Flash player
 Last 50 Posts
 Back
Change Theme...
  • Users » 1
  • Posts/Pages » 164
  • Comments » 150
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

Contact



    No Child Pages.