Connect

Connect is used to connect to a machine (either local or remote) on which you want to open files.

Syntax

Connect (IP or NetBIOS name)

Returns

File Object.

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