Source Address:
Http://www.zhouguoqing.com.cn/article.asp? Id = 50
'Fso File Operations
'Fso Parameter Details:
'Fso. IsRootFolder = True | false' indicates whether the root directory is used.
'Fso. getfolder': Set fldr = Fso. GetFolder ("C: \ directory 2 ")
'Fso. FolderExists = True | false' to check whether the folder exists.
'Fso. createfolder': Fso. CreateFolder ("C: \ directory 1 ")
'Fso. getbasename': Fso. GetBaseName ("C: \ directory 1 ")
'Fso. deleteolder': Fso. DeleteFolder ("C: \ directory 1 ")
'Fso. moveFolder: fso. moveFolder ("C: \ directory 1", "C: \ directory 2") Move C: \ directory 1 to C: \ directory 2
'Fso. copyFolder 'Copy the specified folder usage: fso. copyFolder ("C :\\ directory 2 \ cnbruce", "c :\\") Copy C: \\ directory 2 \ cnbruce to C :\\
'
'Fso. Drive 'returns the Drive name and returns "D :"
'Fso. getdrivename' extract the drive name and return "d :"
'Fso. GetDrive ': Fso. GetDrive (fso. GetDriveName (drvPath ))
'Disk drive information
'Drv. driveletter' returns the drive letter.
'Drv. volumename' gets the volume label of the drive.
'Drv. totalsize' gets the total size of the space, returns the number of bytes, formatted with FormatNumber (Drive. TotalSize/, 0), and returns the number of GB
The size of the remaining space in 'drv. freespace' is returned.
'Drv. DriveType 'file type 0 "device cannot recognize" 1 "floppy disk drive" 2 "hard disk drive" 3 "network hard drive" 4 "disc drive" 5 "RAM Virtual Disk"
'Drv. filesystem' disk format
'Drv. serialnumber' disk serial number
'Drv. isready' available
'Drv. path' disk Path
'
'Fso File Operations
'Txt. opentextfile': fso. OpenTextFile (whichfile, 1) parameter 1: "ForReading: Read-only, no write ." Parameter 2: "ForWriting: readable, writable ." Parameter 8: "ForAppending: open the file and write it from the end of the file"
'Txt. readline' reads a whole line.
'Txt. Read (7) 'reads a specified number of characters
'Txt. readall' reads all text content
Use 'txt. createtextfile' to create a file: Set MyFile = Txt. CreateTextFile (whichfile, True) True to overwrite an existing file
'Txt. WriteLine ': Txt. WriteLine ("welcome to this site ")
'Txt. name' returns the file Name.
'Txt. Short path' returns the short path name of the file.
'Txt. path' returns the physical address of the file.
'Txt. bubutes 'returns the file Attributes
'Return value appendix:
'Normal 0 Normal file. No Attribute Set
'Readonly 1 read-only file. Read/write
'Den 2 hides the file. Read/write
'System 4 System file. Read/write
'Directory 16 folder or Directory. Read-Only
'Archive 32 the file that has been changed since the last backup. Read/write
'Alias 1024 links or shortcuts. Read-Only
'Compressed 2048. Read-Only
'
'Txt. Move ': Set Txt = fso. GetFile (whichfile) Txt. Move "C :\\"
'Txt. copy': Set Txt = fso. GetFile (whichfile) Txt. Copy "D :\\"
'Txt. delete': Set Txt = fso. GetFile ("d: \ cnbruce.txt") Txt. delete
'
'
'Txt. size' returns the file Size.
'Txt. type' returns the file Type
'Txt. DateCreated 'returns the file creation time.
'Txt. datelastaccesssed 'returns the last Object Access time.
'Txt. datelastmodified' returns the last object modification time.
'
'
'Common function record
'Instr' usage: alert (instr ("Abcde", ""))
'Mid 'usage: alert (mid ("abjdllodfjd", 8th) Description: displays this character from the second to the second.
'
'------------------------------------------------