Computer forced downloaded a file called fso






















Returns a Drives collection, which is a list of physical and logical drives on the system. Methods of the FileSystemObject. Appends file path information to an existing file path. Copies files from one location to another. Copies folders and their contents from one location to another. Creates a text file and returns a TextStream object.

Deletes a folder and all of its contents. Determines if a drive exists. Determines if a file exists. Determines if a folder exists. Returns the full path to a file or folder. Returns the base name of a file or folder. Returns a drive object. Returns a file extension from a path.

Returns a file object. Returns a filename from a path. Returns a folder object. Returns the parent folder name from a path. Returns an object pointer to a special folder. Returns a temporary randomly generated file or folder name that can be used with CreateTextFile. Moves files from one location to another. Moves folders and their contents from one location to another. Opens an existing text file and returns a TextStream object.

Properties of the Drive Object. The amount of available Drive space in bytes. A string containing the letter of the Drive without a colon e. An integer value indicating the Drive type. Same as AvailableSpace. A Boolean indicating whether or not a Drive is ready for use.

A string containing the Drive 's path e. A Folder object containing the root folder of Drive. A long value containing the Drive serial number. With network drives, returns a string containing the network share name. The total Drive size in bytes. A string value containing the Drive volume name. Properties of the Folder Object. An integer value indicating Folder 's attributes. The date the folder was created. The date the folder was last accessed. The date the folder was last modified.

The Drive where the folder is located. A Boolean indicating whether or not a Folder is the root folder. A string containing the Folder 's name. A string containing the Folder 's parent folder name. A string containing the Folder 's path.

The total size in bytes of all subfolders and files. A string containing the Folder type e. Methods of the Folder Object. Deletes the Folder. Moves the Folder. Copies the Folder. Properties of the File Object. An integer value indicating File 's attributes.

The date the file was created. The date the file was last accessed. The date the file was last modified. The Drive where the file is located. A string containing the File 's name. The Folder object of the file's parent folder. A string containing the File 's path. The total size in bytes of the file. A string containing the File type e. Methods of the File Object. Deletes the File. Moves the File. Copies the File. Returns a TextStream object that can be used to work with the newly created file.

Properties of the TextStream Object. A Boolean indicating whether or not the file pointer is at the end of a line in the text file used when reading character by character. A Boolean indicating whether or not the file pointer is at the end of file used when reading line by line.

The column number of the current character position in a TextStream file. The current line number in a TextStream file. Methods of the TextStream Object.

Closes an open TextStream file. Reads a specified number of characters from a TextStream file and returns the resulting string. Reads an entire TextStream file and returns the resulting string.

Reads an entire line up to, but not including, the newline character from a TextStream file and returns the resulting string. Skips a specified number of characters when reading a TextStream file. Skips the next line when reading a TextStream file. Writes a specified string to a TextStream file. Writes a specified string and newline character to a TextStream file. Writes a specified number of newline characters to a TextStream file. The first sample program is equivalent of the sample program presented in the previous topic on File System Commands and Functions.

For convenience, the "task at hand" is repeated below:. As a vehicle to demonstrate commonly used file system commands and functions, the tasks in a student exercise to practice MS-DOS commands has become the work to be done by the sample program. Let us take a look at the original student exercise. The students were given a floppy disk containing the following files, all in the root directory:. The students were instructed to make six directories on their disk and move the indicated files to their proper directory as shown below.

When done with this step, there should be NO files in the root directory. Create a directory called:. For files with these extensions:. I discourage this approach as it makes it harder to share the file with other users without having to explain how to reference the library. The native VBA approach is better for creating binary files or writing to files. Below are examples show how to check if one of these exists or is missing.

The FileSystemObject allows you to copy files and folders. Lookup CopyFile and CopyFolder on details:. However, it comes useful when you want to obtain file or folder properties. Below a simple example of how to obtain a File and Folder various properties. VBA CopyFile. Contents Exit focus mode. Is this page helpful? Please rate your experience Yes No. Any additional feedback?

In this article. Creates a text file and returns a TextStream object that can be used to read from, or write to the file. Returns the complete path from the root of the drive for the specified path. Returns a Drive object corresponding to the drive in a specified path.



0コメント

  • 1000 / 1000