littlecharva
littlecharva

Reputation: 263

.NET: How do I find the Desktop path when Folder Redirection is on?

I have been using

Environment.GetFolderPath(Environment.SpecialFolder.Desktop)

to get the path to the user's desktop for ages now, but since we changed our setup here at work so we use Folder Redirection to map our users' Desktop and My Documents folders to the server, it no-longer works. It still points to the Desktop folder in C:\Documents and Settings, which is not where my desktop lives.

Any ideas on how to fix this?

Burns

Upvotes: 4

Views: 3544

Answers (1)

John Sibly
John Sibly

Reputation: 23066

You need to use the DesktopDirectory special folder instead:

Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)

should give you the redirected directory.

Upvotes: 9

Related Questions