Click to See Complete Forum and Search --> : Dump a text file to StdOut


SJ Smith
August 31st, 2006, 11:57 AM
I have the following code in a script



var f = fso.GetFile(strCompileTxt);
var ts = f.OpenAsTextStream(1 /*For Reading*/,
-2 /*TristateUseDefault*/);

while(!ts.AtEndOfStream)
WScript.Echo(ts.ReadLine());

ts.Close();
f.Delete(true);


fso is a FileSystemObject. I wish to dump the file to StdOut and then delete it.

For some reason this code never makes it past the while loop. it just goes on forever. the file is only a few KB.

Any idea what would cause this or if there is a better method of doing this?

Thanks,