"Access is denied" on "My Pictures" in Windows Vista

Just for the record, in case anyone gets stuck with this issue.

The “C:/Users/username/Documents” folder in Vista has three hidden junctions named “My Pictures”, “My Music” and “My Videos” which point to the folders “Pictures”, “Music” and “Video” inside the “C:/Users/username” folder. But they have the “List folder / read data” permission denied for all users as default. So any attempt to open them will result in a “Access denied” error.

It’s possible to “fix” this, but I don’t recommend it. Just open the pointed folders.

The question is, of course, why the permission is set, and why there are those hidden junctions in the first place?

I’m only guessing here, but it makes sense. The junctions are there for compatibility. If a program was written with a reference to a file inside the “(My Documents Folder)/My Pictures” path (assuming the “My Pictures” folder would always be inside the My Documents folder), it would break on Vista. With the junction, you can write to or read any files inside this (now non existent) folder.

(That is why there is also a junction “C:\Documents and Settings” pointing to “C:\Users”)

And why is the list folder permission denied? At first I thought it was there to prevent an infinite loop on programs who list the directory tree recursively, but those junctions don’t point to parent directories…

And the last question is, of course, why they changed those folders locations in the first place? Well, I must admit it’s much better this way (spaces inside paths are a pain).