Oggetto FileSystemObject

L'oggetto FileSystemObject viene utilizzato per accedere al file system su un server.

Questo oggetto può manipolare i file. Con questo oggetto è anche possibile recuperare le informazioni sul file system.

Il codice seguente crea un file di testo (c:\test.txt) e quindi scrive del testo nel file.

Dim fso, tso
Set fso = CreateObject("Scripting.FileSystemObject")
Set tso = fso.CreateTextFile("C:\test.txt", True)   ' Creates a text file (overwrites if exists).
tso.WriteLine("Hello, this is a test file.")        ' Writes text to the file.
tso.Close                                          ' Closes the file.

Set tso = Nothing
Set fso = Nothing