0% found this document useful (0 votes)
46 views2 pages

Excercise 10

This document demonstrates how to create, write to, and read from a text file in Visual Basic Script. It creates a new text file called sampletest2.txt, writes the line "wow!! this is also working" to the file, then reads and prints each line of the file to demonstrate that the write was successful.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views2 pages

Excercise 10

This document demonstrates how to create, write to, and read from a text file in Visual Basic Script. It creates a new text file called sampletest2.txt, writes the line "wow!! this is also working" to the file, then reads and prints each line of the file to demonstrate that the write was successful.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EXERCISE 10

Date:Aim:- Creating a text file writing and reading content of the file

Set objfilestream=CreateObject("scripting.FileSystemobject")
Set textfileobj=objfilestream.createtextfile("F:\alltestingexercise\sampletest2.txt",true)
Set textfileobj=objfilestream.getfile("F:\alltestingexercise\sampletest2.txt")

Set wrtob=textfileobj.openastextstream(2,0)
Set rdob=textfileobj.openastextstream(1,0)
wrtob.writeline("wow!! this is also working")
wrtob.close
While not rdob.atendofstream
print rdob.readline
Wend

You might also like