VBscript error input past end of file

You get that error when you call ReadAll on an empty file. Check the AtEndOfStream property and read the content only if it’s false:

If Not file.AtEndOfStream Then fileText = fileText & file.ReadAll

Leave a Comment