MY.COMPUTER.FILESYSTEM

The My.Computer.FileSystem object provides tools for working with drives, directories, and files. The following table summarizes this object’s properties.

PROPERTY DESCRIPTION
CurrentDirectory Gets or sets the fully qualified path to the application’s current directory.
Drives Returns a read-only collection of DriveInfo objects describing the system’s drives.
SpecialDirectories Returns a SpecialDirectoriesProxy object that has properties giving the locations of various special directories (such as the system’s temporary directory and the user’s MyDocuments directory). See the following section “My.Computer.FileSystem.SpecialDirectories” for more information.

The following list describes the My.Computer.FileSystem object’s methods:

METHOD PURPOSE
CombinePath Combines a base path with a relative path reference and returns a properly formatted fully qualified path. For example, the following code displays the name of the directory that is the parent of the application’s current directory: MessageBox.Show(My.Computer.FileSystem.CombinePath (My.Computer.FileSystem.CurrentDirectory(), "..").
CopyDirectory Copies a directory. Parameters indicate whether to overwrite existing files, whether to display a progress indicator, and what to do if the user presses Cancel during the operation.
CopyFile Copies a file. Parameters indicate whether to overwrite existing files, whether to display a progress indicator, and what to do if the user presses ...

Get Visual Basic 2012 Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.