Partager via


FileSystemObject Methods

 

The following sections provide details about the FileSystemObject methods.

Note

This list includes methods supported on objects that you create using the FileSystemObject, such as File and Folder objects. For more info on these objects, see FileSystemObject Objects.

In This Section

  • Add Method (Folders)
    Adds a new folder to a Folders collection.

  • BuildPath Method
    Appends a name to an existing path.

  • Close Method
    Closes an open TextStream file.

  • Copy Method
    Copies a specified file or folder from one location to another.

  • CopyFile Method
    Copies one or more files from one location to another.

  • CopyFolder Method
    Recursively copies a folder from one location to another.

  • CreateFolder Method
    Creates a folder.

  • CreateTextFile Method
    Creates a specified file name and returns a TextStream object that can be used to read from or write to the file.

  • Delete Method
    Deletes a specified file or folder.

  • DeleteFile Method
    Deletes a specified file.

  • DeleteFolder Method
    Deletes a specified folder and its contents.

  • DriveExists Method
    Returns true if the specified drive exists; false if it does not.

  • FileExists Method
    Returns true if a specified file exists; false if it does not.

  • FolderExists Method
    Returns true if a specified folder exists; false if it does not.

  • GetAbsolutePathName Method
    Returns a complete and unambiguous path from a provided path specification.

  • GetBaseName Method
    Returns a string containing the base name of the last component, less any file extension, in a path.

  • GetDrive Method
    Returns a Drive object corresponding to the drive in a specified path.

  • GetDriveName Method
    Returns a string containing the name of the drive for a specified path.

  • GetExtensionName Method
    Returns a string containing the extension for the last component in a path.

  • GetFile Method
    Returns a File object corresponding to the file in a specified path.

  • GetFileName Method
    Returns the last component of specified path that is not part of the drive specification.

  • GetFileVersion Method
    Returns the version number of a specified file.

  • GetFolder Method
    Returns a Folder object corresponding to the folder in a specified path.

  • GetParentFolderName Method
    Returns a string containing the name of the parent folder of the last component in a specified path.

  • GetSpecialFolder Method
    Returns the special folder object specified.

  • GetStandardStream Method
    Returns a TextStream object corresponding to the standard input, output, or error stream.

  • GetTempName Method
    Returns a randomly generated temporary file or folder name that is useful for performing operations that require a temporary file or folder.

  • Move Method
    Moves a specified file or folder from one location to another.

  • MoveFile Method
    Moves one or more files from one location to another.

  • MoveFolder Method
    Moves one or more folders from one location to another.

  • OpenAsTextStream Method
    Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.

  • OpenTextFile Method
    Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.

  • Read Method
    Reads a specified number of characters from a TextStream file and returns the resulting string.

  • ReadAll Method
    Reads an entire TextStream file and returns the resulting string.

  • ReadLine Method
    Reads an entire line (up to, but not including, the newline character) from a TextStream file and returns the resulting string.

  • Skip Method
    Skips a specified number of characters when reading a TextStream file.

  • SkipLine
    Skips the next line when reading a TextStream file.

  • Write Method
    Writes a specified string to a TextStream file.

  • WriteBlankLines Method
    Writes a specified number of newline characters to a TextStream file.

  • WriteLine Method
    Writes a specified string and newline character to a TextStream file.