My.Computer.FileSystem.SpecialDirectories Object

Provides properties for accessing commonly referenced directories.

Remarks

If the path for the referenced directory is empty, usually due to the operating system not supporting the directory, a DirectoryNotFoundException exception is thrown.

No backslash (\) appears at the end of the path.

Tasks

The following table lists examples of tasks involving the My.Computer.FileSystem.SpecialDirectories object.

To

See

Read from the MyDocuments directory

How to: Retrieve the Contents of the My Documents Directory in Visual Basic

Example

This example returns the filePath for the user's Desktop directory and displays it.

Dim filePath As String
filePath = My.Computer.FileSystem.SpecialDirectories.Desktop
MsgBox(filePath)

Requirements

Namespace:Microsoft.VisualBasic.MyServices

Class:SpecialDirectoriesProxy (provides access to SpecialDirectories)

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

See Also

Reference

My.Computer.FileSystem.SpecialDirectories Object Members

My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData Property

My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData Property

My.Computer.FileSystem.SpecialDirectories.Desktop Property

My.Computer.FileSystem.SpecialDirectories.MyDocuments Property

My.Computer.FileSystem.SpecialDirectories.MyMusic Property

My.Computer.FileSystem.SpecialDirectories.MyPictures Property

My.Computer.FileSystem.SpecialDirectories.Programs Property

My.Computer.FileSystem.SpecialDirectories.Temp Property

My.Computer.FileSystem Object

Microsoft.VisualBasic.FileIO.SpecialDirectories