Read/Write Files with VBScript
Read and write textfiles with VBScript.
Inputs
In the source.
Assumes
In the source.
Returns
In the source.
Side Effects
In the source.
API Declarations
None.
Rate Read/Write Files with VBScript
(3(3 Vote))
rem This function will write a file.
rem Usage: WriteStuff ,
Function WriteStuff(fileout,textout)
Dim filesys,filetxt
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.CreateTextFile(fileout,True)
filetxt.WriteLine(textout)
filetxt.Close
End Function
rem This function will read the contents of a textfile.
rem Usage: buffer = ReadStuff()
Function ReadStuff(fileout)
Dim filesys,filetxt
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile(fileout)
ReadStuff = filetxt.ReadAll
filetxt.Close
End Function
Read/Write Files with VBScript Comments
No comments yet — be the first to post one!
Post a Comment