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 42 43 44 45 46 47
| ' ###########################################################################
' # Creation du fichier d'inventaire logiciels #
' ###########################################################################
' ########################## definition des variables ###############################
' ### Creation d'objet
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objComputer = CreateObject("Shell.LocalMachine")
' ### Emplacement de la clé de registre
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
strEntry1a = "DisplayName"
' ### en local
strComputer = "."
' ############################### Debut du script ####################################
' ### On vas chercher les info dans le registre
Set objReg = GetObject("winmgmts://" & strComputer & "/root/default:StdRegProv")
objReg.EnumKey HKLM, strKey, arrSubkeys
' ### Pour Chacune des ligne du registre
For Each strSubkey In arrSubkeys
' ### On lit les info du registre
intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, strEntry1a, strValue1)
' ### Si valeur du registre different de zero
If intRet1 <> 0 Then
' ### On lit les info du registre
objReg.GetStringValue HKLM, strKey & strSubkey, strEntry1b, strValue1
End If
' ### Si valeur du registre n'est pas vide
' ### J'ecris chaque ligne dans le fichier
'wscript.echo(strValue1)
if strvalue1 = "Security Update for Windows XP (KB963027)" then
Wscript.echo "KB963027 trouvé"
End If
Next |
Partager