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 48 49 50 51 52 53 54 55 56 57 58 59
| ' List All Installed Software
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strComputer = "."
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
strEntry1a = "DisplayName"
boolDiff = False
ApplicationName = ""
Dim ts, fso, Line
Set fso = CreateObject("Scripting.FileSystemObject")
Set objReg = GetObject("winmgmts://" & strComputer & _
"/root/default:StdRegProv")
objReg.EnumKey HKLM, strKey, arrSubkeys
set ts = fso.OpenTextFile("inventory.csv", 1, True)
If Not fso.FileExists("inventory.csv") Then
wscript.echo "Error : inventory file is missing !"
Else
set ts = fso.OpenTextFile("inventory.csv", 1, True)
End If
For Each strSubkey In arrSubkeys
intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
strEntry1a, strValue1)
If intRet1 <> 0 Then
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry1b, strValue1
End If
If strValue1 <> "" Then
Do While ts.AtEndOfStream <> true
Line = ts.ReadLine
wscript.echo "Display Name : " & strValue1 & " Line : " & Line
If StrComp(strValue1,Line) <> 0 Then
'wscript.echo "Line :" & Line & " Reg : " & strValue1
'wscript.echo "new reg entry : " & strValue1
ApplicationName = strValue1
Exit For
End If
Loop
End If
Next
if ApplicationName <> "" Then
wscript.echo "application : " & ApplicationName
End if
'wscript.echo "edition du MSI avec :" & ApplicationName
'Edit MSI
ts.Close |
Partager