1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Option Explicit
' déclaration des variables
Dim oReg
Dim arrValues, arrBytes
Dim strValue, strId
Dim strSubKey: strSubKey = _
"Software\Microsoft\Windows NT\CurrentVersion\" & _
"Windows Messaging Subsystem\Profiles\Outlook\" & _
"9375CFF0413111d3B88A00104B2A6676"
' définition des constantes
Const HKCU = &H80000001
' initialisation des objets
Set oReg = GetObject ("winmgmts:/root/default:stdregprov")
' lecture des valeurs
oReg.EnumValues HKCU, strSubKey, arrValues
For Each strValue In arrValues
' traitement des clsid
If Left (strValue, 1) = "{" Then
' lecture des id (Big-endian)
oReg.GetBinaryValue HKCU, strSubKey, strValue, arrBytes
If UBound (arrBytes) = 3 Then
' formatage de l'id (Little-endian)
strId = _
Left ("00",2-Len(Hex(arrBytes(3)))) & Hex(arrBytes(3)) & _
Left ("00",2-Len(Hex(arrBytes(2)))) & Hex(arrBytes(2)) & _
Left ("00",2-Len(Hex(arrBytes(1)))) & Hex(arrBytes(1)) & _
Left ("00",2-Len(Hex(arrBytes(0)))) & Hex(arrBytes(0))
' les comptes par défaut sont épargnés
If CInt ("&H" & strId) > 2 Then
' suppression des comptes
oReg.DeleteValue HKCU, strSubKey, strValue
oReg.DeleteKey HKCU, strSubKey & "\" & strId
End If
End If
End If
Next |
Partager