Dim Count As Integer Dim Item As Integer Dim DirMax As Integer Dim DirCount As Integer ##################################################################### Private Sub cmdDir_Click() ' Adds all .ini's from directory to lstdirectory list box Dim FileName As String FileName = Dir$("C:\TEST\" & "\*.ini*") lstdirectory.Clear Do While FileName <> "" lstdirectory.AddItem "C:\TEST\" + FileName FileName = Dir ' No parameters means to return next match. Loop DirMax = lstdirectory.ListCount DirCount = 0 End Sub ##################################################################### Private Sub cmdPopulate_Click() ' Opens .ini from lst directory and read each line into List1 Dim textfile As String Dim strArray() As String If DirCount < DirMax Then List1.Clear Open lstdirectory.List(DirCount) For Input As #1 Do While Not EOF(1) Line Input #1, textfile strArray = Split(textfile, ",") For i = 0 To UBound(strArray) If Not Trim(strArray(i)) = "" Then List1.AddItem strArray(i) End If Next Loop Close #1 Item = 0 Count = List1.ListCount Else MsgBox "Package List Cleared!", vbExclamation, "Complete" End If End Sub ############################################################################### Private Sub cmdRemove_Click() ' Checks each entry in List1 for "INSTALL_FAILED" and removes each occurance Do While Item < Count If InStr(List1.List(Item), "INSTALL_FAILED") > 0 Then List1.RemoveItem (Item) Count = Count - 1 Else Item = Item + 1 End If Loop End Sub ############################################################################## Private Sub cmdSave_Click() ' Saves modified List1 contents back into the .ini If DirCount < DirMax Then Open lstdirectory.List(DirCount) For Output As #1 For a = 0 To List1.ListCount - 1 Print #1, List1.List(a) Next a Close #1 DirCount = DirCount + 1 Else End If End Sub