◎ Common objects and methods of 7-fso in simple tutorial of vbs Script Programming

Source: Internet
Author: User

File systems are one of the most important parts of all operating systems. scripts often need to access and manage files and folders, fileSystemObject (FSO) is the top-level object for accessing desktops and file systems in vbs. This object is particularly complex and is the core of vbs file operations. The content of this section should be well known.

FSO contains the following common objects:

Drive object: contains information about storage devices, including hard drives, optical drives, ramdisks, and network drives.

Drives collection: provides a list of physical and logical drives

File object: Check and process files

Files set: provides a list of files in a folder.

Folder object: Check and process folders

Folders set: provides a list of folder subfolders.

Textstream object: read/write text files

Common FSO methods include:

Buw.path: adds the file path information to the existing file path.

Copyfile: copy an object

Copyfolder: copy a folder

Createfolder: Create a folder

Createtextfile: Creates text and returns a textstream object.

Deletefile: delete an object

Deletefolder: delete a folder and all its contents.

Driveexits: determines whether the drive exists

Fileexits: determines whether a file exists

Folderexists: determines whether a folder exists

Getabsolutepathname: returns the absolute path of a folder or file.

Getbasename: returns the basic path of a file or folder.

Getdrive: returns a dreve object.

Getdrivename: returns the name of a drive.

Getextensionname: returns the extension.

GetFile: returns a file object.

Getfilename: returns the name of the file in the folder.

Getfolder: returns a folder object.

Getparentfoldername: returns the parent folder of a folder.

Getspecialfolder: returns the object pointer to a special folder.

Gettempname: returns the name of a randomly generated file or folder that can be used by createtextfile.

Movefile: Move a file

Movefolder: Move a folder

Opentextfile: open an existing file and return a textstream object.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.