My.Computer.FileSystem.SpecialDirectories Object
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

My.Computer.FileSystem.SpecialDirectories Object 

Provides properties for accessing commonly referenced directories.

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.

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

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

Dim filePath As String
filePath = My.Computer.FileSystem.SpecialDirectories.Desktop

Namespace: Microsoft.VisualBasic.MyServices

Class: SpecialDirectoriesProxy (provides access to SpecialDirectories)

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

© 2015 Microsoft