Home Blogs Library Forums Support Advertise
VB Script
 
A Basic Tutorial
File System Programing
 
VBScript and MS Excel
VBScript and MS Access
 
VBScript and MS Word
VBScript and MS Powerpoint
 
Windows Registry Programing
 
Windows Administration
 
Active Directory Programing
 
Miscellaneous Functions
 
You are here...
Home > Vb Script - Home > File System programing > The File System Object

VBScript - The File System Object

The file system object is used to gain access to the computer's file system. All the file and folder operations are performed using this object. Before doing any file and folder operations we need to create an instance of file system object. This is done using the 'CreateObject' function. The following piece of code shows how to create a vbscript file system object.

Dim ObjFso

Set ObjFso = CreateObject("Scripting.FileSystemObject")

The vbscript file system object is for the use of Text files only. It cannot open binary file like pictures, movie files etc in binary mode. It identifies the End Of File using either the length of the file or the End Of File character (ASCII Code 26). So while reading from a file, if it sees the character 26 it will say that the end of file is reached ('AtEndOfStream' will return 'True'), even though the end of the file is not reached. Vbscript is unable to handle this deficiency. (In normal text files character 26 usually will not occur)