Write the below written QTP code inside a notepad and save it as a .vbs file. You can either run it from command prompt or run it by double-clicking on it.
VBScript Code - The following code appends a text to a file. If the file does not exist, it creates the file.
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set FSO = CreateObject("Scripting.FilesystemObject")
Set QTPfile = FSO.OpenTextFile("c:\myfile.txt", ForAppending, True)
QTPfile.WriteLine("Myfirst line of text.")
QTPfile.Close
Sunday, December 12, 2010
VBScript Code | Appending text to File
at 8:58 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment