Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bohack/58f21b6737440ae4fe7afd110025e706 to your computer and use it in GitHub Desktop.
Save bohack/58f21b6737440ae4fe7afd110025e706 to your computer and use it in GitHub Desktop.
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
strPathtoTextFile = "."
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoTextFile & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"""
objRecordset.Open "SELECT * FROM Ouitable.csv", _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
arrRecords = objRecordset.Getrows
For row = LBound(arrRecords, 2) To UBound(arrRecords, 2)
'wscript.Echo arrRecords(0,row)
If ucase(Wscript.Arguments(0))=ucase(arrRecords(0,row)) Then
Wscript.Echo "Mac: " & arrRecords(0,row) & " Vendor: " & arrRecords(1,row)
End If
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment