HOWTO: Write a file using VBScript

 ‘——————————————————————————-‘ WriteFileText – Used to write an item to a file in a folder.’ Parameters:’   sFile – The file to read’ ‘ Returns:’   A string containing the content of the file.’——————————————————————————-Function WriteFileText(sFilePath, sText)    Dim objFSO ‘As FileSystemObject    Dim objTextFile ‘As Object        Const ForReading = 1    Const ForWriting = 2    Const ForAppending = 8       …

7

Howto: VBScript – Read a file

‘———————————————————————————–‘ ReadFileText – Used to read  a file in a folder.’ Parameters:’   sFile – The file to read’ ‘ Returns:’   A string containing the content of the file.’———————————————————————————–Function ReadFileText (sFile)    Dim objFSO ‘As FileSystemObject    dim oTS    dim sText         Set objFSO = CreateObject(“Scripting.FileSystemObject”)     Set oTS = objFSO.OpenTextFile(sFile)    sText = oTS.ReadAll     oTS.close    set…

4