VBScript Error: Invalid Procedure call or argument
Posted on 2004-08-03
I was trying to run a simple vbscript, in which i open a text file for reading. I tried this simple script and it gives a runtime error 800A0005. It works fine when i replace OpenTextFile with CreateTextFile. So, does that mean i have an older version of the scripting engine or am I missing something.
Dim filesys, testfile
Set filesys = CreateObject("Scripting.FileSystemObject")
Set testfile= filesys.OpenTextFile("c:\somefile.txt",ForReading,True)
testfile.WriteLine "Your text goes here."
I have windows xp, vbscript version 5.6.
Thanks in advance