Write

Write is used to write a string to a file without appending a CRLF (Carriage Return Line Feed) at the end of the provided string.

Syntax

Write(string, [number_of_bytes])

Returns

No data returned.

More Information

Number_of_bytes is an optional parameter, if omitted its value will be automatically calculated according to the size of the string passed.

Example

This script opens a file (test.txt) on the local C drive and writes 2 lines to it:

Function Main

Dim textfile As Object

Set textfile = File.Connect("127.0.0.1")

If textfile.Open("c:\test.txt", GENERIC_WRITE, CREATE_ALWAYS) Then

textfile.WriteLine("Hi, This is a test file")

textfile.WriteLine("It was created using GFI LanGuard scripting")

textfile.Close

End If

End Function