I\'m trying this code:
filename = \"test.txt\"
listFile = fso.OpenTextFile(filename).ReadAll
listLines = Split(listFile, vbCrLf)
For Each line In listLines
Your code seems to be working fine. I changed it slightly to show that the lines are, in fact, read line-by-line:
Set fso=CreateObject("Scripting.FileSystemObject")
filename = "test.txt"
listFile = fso.OpenTextFile(filename).ReadAll
listLines = Split(listFile, vbCrLf)
i = 0
For Each line In listLines
WScript.Echo CStr(i) + " : " + line
i = i + 1
'My Stuff
Next
I assume fso is set in your script somewhere, but I added that extra line just for completeness.
You should verify that your input file does, indeed, have multiple lines separated by vbCrLf. The counter i helps in debugging each line as it shows the line index during reading the lines.