Page 1 of 1

VBS: read textfile to variable

Posted: Wed Oct 25, 2006 12:43 pm
by Hannes, Tech Support
This piece of code reads a textfile "test.txt" and stores its content in a variable "inputData" (taken from topic http://forum.iopus.com/viewtopic.php?p=4965#4965):

Code: Select all

Dim objFileSystem, objInputFile

Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objInputFile = objFileSystem.OpenTextFile("test.txt", 1)

' read everything in an array
inputData = objInputFile.ReadAll

objInputFile.Close

msgbox inputData 

Re: VBS: read textfile to variable

Posted: Wed Feb 25, 2009 6:23 pm
by etzel
Can this be used with the Firefox .js support with textfiles which contain conditional statements? such as checking for captcha, if found prompt for captcha, else next iimplay, on captchaprompt ok button submit, iimplay...

That would make my life a whole lot simpler