Sideway
output.to from Sideway
Draft for Information Only

Content

VBScript Methods of FSO Object
 BuildPath Method
  Syntax
  Argument
  Remark
  Applied to
 CopyFile Method
  Syntax
  Argument
  Remark
  Applied to
 CopyFolder Method
  Syntax
  Argument
  Remark
  Applied to
 CreateFolder Method
  Syntax
  Argument
  Remark
  Applied to
 CreateTextFile Method
  Syntax
  Argument
  Remark
  Applied to
 DeleteFile Method
  Syntax
  Argument
  Remark
  Applied to
 DeleteFolder Method
  Syntax
  Argument
  Remark
  Applied to
 DriveExists Method
  Syntax
  Argument
  Remark
  Applied to
 FileExists Method
  Syntax
  Argument
  Remark
  Applied to
 FolderExists Method
  Syntax
  Argument
  Remark
  Applied to

VBScript Methods of FSO Object

Some typical predefined Elements are.

  • FSO Object:
    • BuildPath Method
    • CopyFile Method
    • CopyFolder Method
    • CreateFolder Method ≡ Folder Object
    • CreateTextFile Method ≡ TextStream object
    • DeleteFile Method
    • DeleteFolder Method
    • DriveExists Method
    • FileExists Method
    • FolderExists Method
    • GetAbsolutePathName Method
    • GetBaseName Method
    • GetDrive Method
    • GetDriveName Method
    • GetExtensionName Method
    • GetFile Method
    • GetFileVersion Method
    • GetFileName Method
    • GetFolder Method
    • GetParentFolderName Method
    • GetSpecialFolder Method
    • GetStandardStream Method
    • GetTempName Method
    • MoveFile Method
    • MoveFolder Method
    • OpenTextFile Method

BuildPath Method

last updated 13 Dec 2017

is to append a given name to the specified existing path.

Syntax

fsoobjvar.BuildPath(path, name)

Argument

fsoobjvarRequired. To specify the associated Object instance reference.BuildPathRequired Keyword. to specify the Method of associated Object.pathRequired. Existing path to which name is appended. Path can be absolute or relative and need not specify an existing folder.nameRequired. Name being appended to the existing path.

Remark

  • Path can be absolute or relative and need not specify an existing folder.
  • The BuildPath method inserts an additional path separator between the existing path and the name, only if necessary.

Applied to

FileSystemObject Object

CopyFile Method

last updated 13 Dec 2017

is to copy one or more given source files to the specified destination according to the specified overwrite setting.

Syntax

fsoobjvar.CopyFile ( source, destination[, overwrite] )

Argument

fsoobjvarRequired. To specify the associated Object instance reference.CopyFileRequired Keyword. to specify the Method of associated Object.sourceRequired. Character string file specification, which can include wildcard characters, for one or more files to be copied.destinationRequired. Character string destination where the file or files from source are to be copied. Wildcard characters are not allowed.overwriteOptional. Boolean value that indicates if existing files are to be overwritten. If true, files are overwritten; if false, they are not. The default is true. Note that CopyFile will fail if destination has the read-only attribute set, regardless of the value of overwrite.

Remark

  • Wildcard characters can only be used in the last path component of the source argument.
  • If source contains wildcard characters or destination ends with a path separator (\), it is assumed that destination is an existing folder in which to copy matching files. Otherwise, destination is assumed to be the name of a file to create.
  • In either case, three things can happen when an individual file is copied.
  • If destination does not exist, source gets copied. This is the usual case.
  • If destination is an existing file, an error occurs if overwrite is false. Otherwise, an attempt is made to copy source over the existing file.
  • If destination is a directory, an error occurs.
  • An error also occurs if a source using wildcard characters doesn't match any files. The CopyFile method stops on the first error it encounters. No attempt is made to roll back or undo any changes made before an error occurs.

Applied to

FileSystemObject Object

CopyFolder Method

last updated 13 Dec 2017

is to recursively copy the given source folder to the specified destination according to the specified overwrite setting

Syntax

fsoobjvar.CopyFolder ( source, destination[, overwrite] )

Argument

fsoobjvarRequired. to specify the associated Object instance reference.CopyFolderRequired Keyword. to specify the Method of associated Object.sourceRequired. Character string folder specification, which can include wildcard characters, for one or more folders to be copied.destinationRequired. Character string destination where the folder and subfolders from source are to be copied. Wildcard characters are not allowed. overwriteOptional. Boolean value that indicates if existing folders are to be overwritten. If true, files are overwritten; if false, they are not. The default is true.

Remark

  • Wildcard characters can only be used in the last path component of the source argument.
  • If source contains wildcard characters or destination ends with a path separator (\), it is assumed that destination is an existing folder in which to copy matching folders and subfolders. Otherwise, destination is assumed to be the name of a folder to create.
  • In either case, four things can happen when an individual folder is copied.
  • If destination does not exist, the source folder and all its contents gets copied. This is the usual case.
  • If destination is an existing file, an error occurs.
  • If destination is a directory, an attempt is made to copy the folder and all its contents. If a file contained in source already exists in destination, an error occurs if overwrite is false. Otherwise, it will attempt to copy the file over the existing file.
  • If destination is a read-only directory, an error occurs if an attempt is made to copy an existing read-only file into that directory and overwrite is false.
  • An error also occurs if a source using wildcard characters doesn't match any folders.
  • The CopyFolder method stops on the first error it encounters. No attempt is made to roll back any changes made before an error occurs.

Applied to

FileSystemObject Object

CreateFolder Method

last updated 14 Dec 2017

is to create a folder.object of the specified foldername.

Syntax

fsoobjvar.CreateFolder(foldername)

Argument

fsoobjvarRequired. to specify the associated Object instance reference.CreateFolderRequired Keyword. to specify the Method of associated Object.foldernameRequired. String expression that identifies the folder to create.

Remark

  • An error occurs if the specified folder already exists.
  • The CreateFolder method returns a Folder Object.

Applied to

FileSystemObject Object

CreateTextFile Method

last updated 14 Dec 2017

is to create the given filename file according to the overwrite setting.and to return the associated textStream object that can be used to read from or write to the created file.

Syntax

fsoobjvar.CreateTextFile(filename[, overwrite[, unicode]])
fsofolderobjvar.CreateTextFile(filename[, overwrite[, unicode]])

Argument

fsoobjvar | fsofolderobjvarRequired. to specify the associated Object instance reference.CreateTextFileRequired Keyword. to specify the Method of associated Object.filenameRequired. String expression that identifies the file to create.overwriteOptional. Boolean value that indicates whether you can overwrite an existing file. The value is true if the file can be overwritten, false if it can't be overwritten. If omitted, existing files are not overwritten.unicodeOptional. Boolean value that indicates whether the file is created as a Unicode or ASCII file. The value is true if the file is created as a Unicode file, false if it's created as an ASCII file. If omitted, an ASCII file is assumed.

Remark

  • If the overwrite argument is false, or is not provided, for a filename that already exists, an error occurs.

Applied to

FileSystemObject Object, Folder Object, TextStream Object

DeleteFile Method

last updated 14 Dec 2017

is to delete the given filespec file according to the force setting.

Syntax

fsoobjvar.DeleteFile ( filespec[, force] )

Argument

fsoobjvarRequired. to specify the associated Object instance reference.DeleteFileRequired Keyword. to specify the Method of associated Object.filespecRequired. The name of the file to delete. The filespec can contain wildcard characters in the last path component.forceOptional. Boolean value that is true if files with the read-only attribute set are to be deleted; false (default) if they are not.

Remark

  • An error occurs if no matching files are found. The DeleteFile method stops on the first error it encounters. No attempt is made to roll back or undo any changes that were made before an error occurred.

Applied to

FileSystemObject Object

DeleteFolder Method

last updated 14 Dec 2017

is to delete the given folderspec folder and its contents according to the force setting.

Syntax

fsoobjvar.DeleteFolder ( folderspec[, force] )fsoobjvar.DeleteFolder ( folderspec[, force] )

Argument

fsoobjvarRequired. to specify the associated Object instance reference.DeleteFolderRequired Keyword. to specify the Method of associated Object.folderspecRequired. The name of the folder to delete. The folderspec can contain wildcard characters in the last path component.forceOptional. Boolean value that is true if folders with the read-only attribute set are to be deleted; false (default) if they are not.

Remark

  • The DeleteFolder method does not distinguish between folders that have contents and those that do not. The specified folder is deleted regardless of whether or not it has contents.
  • An error occurs if no matching folders are found.
  • The DeleteFolder method stops on the first error it encounters. No attempt is made to roll back or undo any changes that were made before an error occurred.

Applied to

FileSystemObject Object

DriveExists Method

last updated 14 Dec 2017

is to return a Boolean value indicating the drive of the given drivespec exist with True or does not exist with False.

Syntax

fsoobjvar.DriveExists(drivespec)

Argument

fsoobjvarRequired. to specify the associated Object instance reference.DriveExistsRequired Keyword. to specify the Method of associated Object.drivespecRequired. A drive letter or a complete path specification.

Remark

  • For drives with removable media, the DriveExists method returns true even if there are no media present. Use the IsReady property of the Drive object to determine if a drive is ready.

Applied to

FileSystemObject Object

FileExists Method

last updated 14 Dec 2017

is to return a Boolean value indicating the file of the given filespec exist with True or does not exist with False.

Syntax

fsoobjvar.FileExists(filespec)

Argument

fsoobjvarRequired. to specify the associated Object instance reference.FileExistsRequired Keyword. to specify the Method of associated Object.filespecRequired. The name of the file whose existence is to be determined. A complete path specification (either absolute or relative) must be provided if the file isn't expected to exist in the current folder. Wildcard characters (*, ?, and so on) are not supported.

Remark

  • A complete path specification (either absolute or relative) must be provided if the file isn't expected to exist in the current folder.
  • Wildcard characters (*, ?, and so on) are not supported.

Applied to

FileSystemObject Object

FolderExists Method

last updated 14 Dec 2017

is to return a Boolean value indicating the folder of the given folderspec exist with True or does not exist with False..

Syntax

fsoobjvar.FolderExists(folderspec)

Argument

fsoobjvarRequired. to specify the associated Object instance reference.FolderExistsRequired Keyword. to specify the Method of associated Object.folderspecRequired. The name of the folder whose existence is to be determined. A complete path specification (either absolute or relative) must be provided if the folder isn't expected to exist in the current folder.

Remark

  • A complete path specification (either absolute or relative) must be provided if the folder isn't expected to exist in the current folder.

Applied to

FileSystemObject Object

©sideway

ID: 180500023 Last Updated: 5/23/2018 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019