Using SMS I've created a report on computers with Software in Add/Remove Programs at a particular site, similar to the following:
Netbios Name Manufacturer Model OS Version Size RAM Display Name
SITE-D-ASSET01 Dell OptiPlex GX270 XP 5.1.2600 39205 509 Adobe Acrobat 7.0.1 and Reader 7.0.1 Update
SITE-D-ASSET02 Compaq Evo D510 CMT XP 5.1.2600 19091 247 Windows XP Hotfix - KB891781
SITE-D-ASSET03 Compaq Deskpro XP 5.1.2600 19091 254 Windows XP Hotfix - KB892944
SITE-D-ASSET04 Compaq Deskpro XP 5.1.2600 19091 254 Windows XP Hotfix - KB893066
The aim is to identify computers with Non Standard Build apps i.e. software not included in the Original Computer Build. This includes applications like Adobe Acrobat, Flash Player, Java, Windows XP Hotfixes etc.. I wish to remove these from the list. After some searching I found the following Macro to remove the lines by building an array.
Sub a()
Dim i, C, myArr, j
myArr = Array("Adobe Reader 6.0", "Adobe Acrobat 7.0.1 and Reader 7.0.1 Update", "Security Update for Windows XP (KB890046)", "Security Update for Windows XP (KB893066)", "Security Update for Windows XP (KB893756)")
For i = Range("A65536").End(xlUp).
Row To 1 Step -1
For j = LBound(myArr) To UBound(myArr)
Set C = Rows(i).Find(myArr(j), LookIn:=xlValues)
If Not C Is Nothing Then
Rows(i).Delete
Exit For
End If
Next j
Next i
End Sub
However I'd like to just use a text file for the array so that I could build a list for e.g.
Adobe Acrobat 4.0
Adobe Acrobat 5.0
Adobe Acrobat 7.0.1 and Reader 7.0.1 Update
Adobe Acrobat 7.0.2 and Reader 7.0.2 Update
Adobe Acrobat 7.0.3 and Reader 7.0.3 Update
Security Update for Windows Media Player 9 (KB917734)
Security Update for Windows XP (KB890046)
Security Update for Windows XP (KB893066)
Security Update for Windows XP (KB893756)
and save it to C:\Removal.txt and than I can just add remove lines from the text file.
Does anyone know how I could do that.
Cheers
Start Free Trial