How do I get the current user's special Windows directories?

To get the current user's special directories (such as My Documents, Home, MyComputer, and so on), you use the Environment.SpecialFolder enumeration along with the Environment.GetFolderPath() method. For example, the following code returns the current user's MyDocuments folder.

In C#:

string MyDocsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

And in VB .NET:

Dim MyDocsFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)

© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 09/04/05
Comment or report problem with topic