sc config winmgmt start= disabled
kill -f XXX <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< pid obtained before
cd /D %windir%\system32\wbem
rmdir /s /q repository
rmdir /s /q Logs
mkdir Logs
for /R %i in (*.dll) do (regsvr32 /s %i)
regsvr32 /s fastprox.dll
for /R %i in (*.exe) do (%i -regserver) <<<<<<<<<<<<< this will open wbemtest and/or wmic.exe. Just close it
sc config winmgmt start= auto
regsvr32 wbemupgd.dll <<<<<<<<<<<<<< this can take 30 seconds to 2 minutes
net start server && net start workstation && net start termservice
snipped fromhttp://groups.google.com/group/microsoft.public.win32.programmer.wmi/msg/1da6ab3690bc75a0>