FileSystemObject

Here I am going to tell you that how variables with the object subtype behave. Let's look at some code that actually uses a real object, in this case the FileSystemObject, which is part of a collection of subjects that allow your VBScript code to interact with the Windows file system.

Dim objFSO
Dim boolExists
Set objFSO = WScript.CreateOnject("Scripting.FileSystemObject")
boolExists = objFSO.FileExists("C:/autoexec.bat")
MsgBox boolExists

In this code, we create a FileSystemObject object and store it in the variable called objFSO. We then use the FileExists method of the object to test for the existence of the autoexec.bat file. Then we display the result of this test in a dialogue box. Note the use of the Set Keyword. When changing the value of an object variable, you must use Set.

First
Next