FileSystem Object
The default WSH scripting languages
(VBScript and JScript) do not have any native file manipulation
capabilities. This functionality is provided by the COM object
FileSystem.
The FileSystem object (FSO) exposes a number of
separate objects that provide the ability to perform file-related
operations. Table 9-18 lists the objects exposed by
the FileSystem component
Table 9-18. FileSystem objects
|
Object |
Description |
|---|---|
|
|
A collection that contains a list of folders for a specified folder |
|
|
Exposes folder information such as size, attributes, and date information and methods to move, delete, and copy |
|
|
A collection that contains a list of files for a specified folder |
|
|
Exposes file information such as size, attributes, and date information and methods to move, delete, and copy |
|
|
Collection object that contains a list of available drives on the local machine |
|
|
Exposes drive information, such as size and type |
|
|
Provides text file manipulation |
The FSO exposes methods and properties that perform file manipulation operations. Before you can reference any of the objects listed in Table 9-18, you must create an instance of the FSO object:
'create an instance of an FSO object
Set objFSO = CreateObject("Scripting.FileSystemObject")The FSO object exposes a number of file manipulation methods and properties. The following commands are a few of the most useful FSO-related methods and properties. See “Additional ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access