Name

FileSystemObject Object

Creatable

Yes

Library

Microsoft Scripting Runtime

Description

The FileSystemObject object is at the top level of the File System object model and is the only externally createable object in the hierarchy; that is, it’s the only object you can create using the CreateObject function or the host object model’s object creation facilities. For example, the following code instantiates a FileSystemObject object named oFS:

Dim oFS
Set oFS = WScript.CreateObject("Scripting.FileSystemObject")

The FileSystemObject object represents the host computer’s filesystem as a whole. Its members allow you to begin navigation into the filesystem, as well as to access a variety of common filesystem services. For information about the FileSystemObject object’s properties and methods, see the entry for each property and method.

For an overview of the file system object model, see the “File System object model” entry.

Properties

Drives (returns a Drives collection object).

Methods

BuildPath

FileExists

GetFileName

CopyFile

FolderExists

GetFolder

CopyFolder

GetAbsolutePathName

GetParentFolderName

CreateFolder

GetBaseName

GetSpecialFolderd

CreateTextFile

GetDrive

GetTempName

DeleteFile

GetDriveName

MoveFile

DeleteFolder

GetExtensionName

MoveFolder

DriveExists

GetFile

OpenTextFile

Get VBScript in a Nutshell 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.