tags:

views:

742

answers:

3

Howdy,

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

A: 

oh man, i need to read slower. i thought you were looking for documents and settings. Agree with John

Darren Kopp
A: 

Where do your desktops live now? If they follow a pattern like:

C:\Foo\*username*\bar\desktop you could use Environment.UserName and strings instead.

IainMH
+4  A: 

Hi Burns,

You need to use the DesktopDirectory special folder instead:

Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)

should give you the redirected directory.

John Sibly