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:

Scripting.FileSystemObject

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.