Previous PageNext Page

7.16 FileSystemObject Object

The FileSystemObject provides access to a computer's file system.
 

Methods

BuildPath
 
Appends a name to an existing path.
 
CopyFile
 
Copies one or more files from one location to another.
 
CopyFolder
 
Copies one or more folders and their contents from one location to another.
 
CreateFolder
 
Creates a folder
 
CreateTextFile
 
Creates a text file with a specified name and returns a TextStream object.
 
DeleteFile
 
Deletes a specified file.
 
DeleteFolder
 
Deletes a specified folder and its contents.
 
DriveExists
 
Returns a Boolean value indicating the existence of a drive.
 
FileExists
 
Returns a Boolean value indicating the existence of a file.
 
FolderExists
 
Returns a Boolean value indicating the existence of a folder.
 
GetAbsolutePathName
 
Returns a complete and unambiguous path from a provided path specification.
 
GetBaseName
 
Returns a string containing the base name of the last component, less any extension, in a path.
 
GetDrive
 
Returns a Drive object corresponding to the drive in a specified path.
 
GetDriveName
 
Returns a string containing the name of a drive for a specified path.
 
GetExtensionName
 
Returns a string containing the extension name for the last component in a path.
 
GetFile
 
Returns a File object corresponding to the file in a specified path.
 
GetFileName
 
Returns the last component of the specified path that is not part of the drive specification.
 
GetFolder
 
Returns a Folder object corresponding to the folder in a specified path.
 
GetParentFolderName
 
Returns a string containing the name of the parent folder of the last component in a specified path.
 
GetSpecialFolder
 
Returns the special folder specified.
 
GetTempName
 
Returns a randomly generated temporary file or folder name.
 
MoveFile
 
Moves one or more files from on location to another.
 
MoveFolder
 
Moves one or more folders and their contents from one location to another.
 
OpenTextFile
 
Opens a specified file and returns a TextStream object.
 

Properties

Drives
 
A collection of all Drive objects available on the local machine. See the Drives collection section.
 

Remarks

The following code illustrates how the FileSystemObject is used to return a TextStream object that can be read from or written to:
 

var fs = new ActiveXObject("Scripting.FileSystemObject");

var a = fs.CreateTextFile("c:\testfile.txt", true);

a.WriteLine("This is a test.");

a.Close();


Copyright © 2000 Chili!Soft

Previous PageTop Of PageNext Page