' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Script VBS pour les problèmes WMI ' http://support.microsoft.com/?kbid=319101 ' script de ~Jean-Marc~ © 2004 http://perso.wanadoo.fr/doc.jm ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On Error Resume Next Dim shell, fso, WinSysDir, RepoPath, RepoPath2 Set shell = WScript.CreateObject("WScript.Shell") Set fso = WScript.CreateObject("Scripting.FileSystemObject") ' Arrêt du service Infrastructure de gestion windows set scriptState = shell.Exec("%comspec% /c echo o|net stop winmgmt") While (scriptState.Status = 0) WScript.Sleep(100) Wend 'Lire le répertoire windows WinSysDir = Shell.RegRead("HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRoot") ' Créer le chemin d'effacement des fichiers du repository RepoPath = WinSysDir & "\System32\Wbem\Repository\*.*" RepoPath2 = WinSysDir & "\System32\Wbem\Repository\FS\*.*" 'Effacement du contenu du répertoire repository fso.DeleteFile RepoPath, true fso.DeleteFile RepoPath2, true fso.DeleteFolder RepoPath, true 'Configuration de Infrastructure de gestion windows en automatique (config d'origine XP) shell.Exec("sc config winmgmt start= auto") 'fin wscript.echo "Fin de la réparation." & vbcrlf & "Redémarrer le PC." Set fso = Nothing Set scriptState = Nothing Set shell = Nothing Wscript.quit