File System Object Model (VB6)

Library to Reference

Microsoft Scripting Runtime (../ SYSTEM32/SCRRUN.DLL )

Description

For years, VB developers have been using the VBA language to perform tasks such as opening, writing, and closing files, but with VB6, that's about to change. Of course, for backward compatibility, all the original file and directory manipulation statements and functions are still there, but now VB includes the File System object model, a rich object model for local and network file access.

The File System object model is itself not an intrinsic part of the VBA language, but is part of the Scripting Runtime library. Those of you familiar with VBScript may recognize the original components of the File System object model, a very basic version of which first appeared in Version 2 of the Scripting Runtime library, when the model simply contained a top-level object, the FileSystemObject object, and the TextStream object. Version 4 of the Scripting Runtime that ships with VB6 contains a full object model that represents all drives that are attached to the computer, including hard drives, floppy and removable media drives, RAM drives, CD-ROM drives, and drives on other machines. The File System object model allows you to interrogate, create, delete, and otherwise manipulate folders and text files. The depth of information that is provided within the object model would have forced you to resort to the Win32 API in previous versions of VB.

To access the File System object ...

Get VB & VBA in a Nutshell: The Language 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.