HP has great document to reference this question Check out [KM171403][1].
Here is write example:
' Write some data to a file.
Dim fso, MyFile
Set fso = CreateObject(''Scripting.FileSystemObject'')
Set MyFile = fso.CreateTextFile(''C:testfile.txt'', True)
MyFile.WriteLine(''This is a test'')
MyFile.WriteLine(''This is another test'')
MyFile.Close
Here is the read example:
' Read the data from the file.
Dim fso, MyFile
Set fso = CreateObject(''Scripting.FileSystemObject'')
Set MyFile = fso.OpenTextFile(''C:testfile.txt'')
MsgBox MyFile.ReadLine
MsgBox MyFile.ReadLine
MyFile.Close
[1]: https://softwaresupport.hp.com/group/softwaresupport/search-result/-/facetsearch/document/KM171403