>Assuming you have the default directory settings, try this code:
>
[quoted text clipped - 18 lines]
>
>What is going on here?
In a nutshell, they're junction points MS added to Vista to help existing
programs that did things the wrong way. This article explains all:
Junction Points and Backup Applications
http://msdn2.microsoft.com/en-us/library/bb756982.aspx
<q>
These junction points have file attributes of FILE_ATTRIBUTE_REPARSE_POINT
& FILE_ATTRIBUTE_SYSTEM and the ACLs are set to Everyone Deny Read.
Applications must have permissions in order to call out and traverse a
specific path. However, enumerating the contents of these junction points
is not possible.
</q>
The article very helpfully lists all the junction points, including the
ones you encountered. Hopefully, there is a Directory::GetDirectories
overload that you can use to prevent it from returning these unwanted
junctions.
To examine the security attributes of these junction points, you'll have to
go to Folder Properties and disable the options that hide files. Then
you'll be able to see them in Documents, as well as several in the root of
your profile folder.

Signature
Doug Harrison
Visual C++ MVP
Peteroid - 03 Nov 2007 14:29 GMT
Thank you, Doug!
I haven't found a version of GetDirectories that doesn't return junction
points. So I screen out junction points by doing a 'GetFiles( )' on it
within a try-catch and screen out those that get caught.
But I do think a version of GetDirectories that doesn't report junction
points is really something MS should include. Any solution that requires
try-catch feels like a 'hack' to me.
>>Assuming you have the default directory settings, try this code:
>>
[quoted text clipped - 46 lines]
> you'll be able to see them in Documents, as well as several in the root of
> your profile folder.
Doug Harrison [MVP] - 03 Nov 2007 17:19 GMT
>Thank you, Doug!
>
[quoted text clipped - 5 lines]
>points is really something MS should include. Any solution that requires
>try-catch feels like a 'hack' to me.
I agree. Maybe you could filter by testing the attributes?

Signature
Doug Harrison
Visual C++ MVP
Peteroid - 03 Nov 2007 23:48 GMT
> I agree. Maybe you could filter by testing the attributes?
Ah crap. I found the Directory class before the DirectoryInfo class (I
should have known better, I was already working eith DriveInfo and FileInfo
classes). I didn't realize I could get attributes since Directory class only
returns the names of the directories.
I did all of my runtime discovery of folders ala try-catch (e.g., that's how
I found out a directory was read-only). But I got 'distracted' with the
Directory class and never thought to look for DirectoryInfo class. Back to
the drawing board (System::Drawing class, for the record).
That was my first instinct. But GetDirectories( ) only returns an array of
the
>>Thank you, Doug!
>>
[quoted text clipped - 7 lines]
>
> I agree. Maybe you could filter by testing the attributes?