I am trying to access information under C:\Users\Public\Documents\ which displays as C:\Users\Public\Public Documents\ on explorer. Is there a way to be able to access the DirectoryInfo of a directory under the junction using the pathname displayed in explorer in .NET C#?
I am trying to access information under C:\Users\Public\Documents\ which displays as C:\Users\Public\Public Documents\ on
Share
When/how are you expecting to get a
C:\users\public\public documentspath?If a user goes to copy/paste from Explorer, the
C:\users\public\documentspath will be copied into the clipboard. Going through aSaveFileDialogalso produces the valid path.If you need a way to access Windows 7 libraries, you can give the Windows API Code Pack a go. You can then access “Public Documents as
KnownFolders.PublicDocuments, for example. From what I can see (I’ve never used it before), there’s still no way to reliably turnC:\users\public\public documentsinto aDirectoryInfo, but you might have better luck digging through the docs.