Sub ListDX()
Dim rng As Range
Dim fs, f, f1, fc, s
Dim LastRow As Long
Dim strPath As String
strPath = "C:\DX\" 'This is the Directory the files are located in
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(strPath)
Set fc = f.Files
Set rng = Worksheets(1).Range("A2")
rng.Offset(-1).Resize(, 7).Value = Array("Machine name", "Operating System", "Processor", "Memory", _
"Card name", "Description", "FileName")
For Each f1 In fc
Open strPath & f1.Name For Input As #1
Do Until InStr(info, "Description:")
Line Input #1, info
If info <> "" Then ' check for blank lines
x = Split(info, ":")
If Trim(x(0)) = "Machine name" Then
rng.Value = Trim(x(1))
End If
If Trim(x(0)) = "Operating System" Then
rng.Offset(, 1).Value = Trim(x(1))
End If
If Trim(x(0)) = "Processor" Then
rng.Offset(, 2).Value = Trim(x(1))
End If
If Trim(x(0)) = "Memory" Then
rng.Offset(, 3).Value = Trim(x(1))
End If
If Trim(x(0)) = "Card name" Then
rng.Offset(, 4).Value = Trim(x(1))
End If
If Trim(x(0)) = "Description" Then
rng.Offset(, 5).Value = Trim(x(1))
End If
End If
Loop
rng.Offset(, 6).Value = f1.Name
Close #1
info = ""
Set rng = rng.Offset(1)
Next
End Sub