Programming the VBScript FileSystemObject

One of the most powerful uses for scripted Automation is accessing the object models exposed by the VBScript engine, particularly the FileSystemObject that gives you access to the local file system. This enables you to create scripts that work with files, folders, and disk drives; read and write text files; and more. You use the following syntax to refer to this object:


For all your file system scripts, you begin by creating a new instance of FileSystemObject:

Set objFS = WScript.CreateObject("Scripting.FileSystemObject")

Here’s a summary of the file system objects you can access via this Automation object:

  • Drive. This object enables you to access the properties of a specified disk ...

Get Insider Power Techniques for Microsoft® Windows® XP now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.