What's actually happening is that those are junctions, something Windows NTFS file systems can use to link folders and provider compatibility to older programs. For example, in Windows XP, you had a c:\Documents and Settings\
In Vista, that is now located at C:\Users\
On my Sony VAIO laptop, the people at Sony built the drive from an image located on some Y:\ drive, so all my junctions were incorrectly pointing to a non-existent Y drive.
It's easiest if you install SysInternals Junction.exe into your C:\Windows\System32 folder so you can call junction from anywhere at the command prompt.
Open command prompt by typing cmd into the Start Search box.
Type cd\ to get to the root C:\ directory
Type dir /aL /s > junction.txt to recursively view all junctions on your harddrive and output it to the junctions.txt file.
Now you can view all the junctions and ensure that all of them are pointing to the correct folders.
Open the junctions.txt file and whenever you see a junction or symbolic link (symlinkd) that is pointing to a non-existent drive, you can go to that directory at the command prompt and relink the junction.
For example, I have a junction in the C:\Users\Default directory that shows:
11/02/2006 07:02 AM <JUNCTION> Application Data [Y:\Users\Default\AppData\Roaming]
To fix this link I'll type:
c:\Users\Default>junction "Application Data" C:\Users\Default\AppData\Roaming
Note the quotes around the first argument since it has spaces in the name. The second argument doesn't have quotes because it has no spaces.
Now, if I type "dir /aL" in this folder, I'll see that this junction is now correct:
11/02/2006 07:02 AM <JUNCTION> Application Data [\??\C:\Users\Default\AppData\Roaming]
Well, I know the first part of the path looks weird ("[\??\C:\...]"), but it works. You can test out the link in windows explorer to ensure that it works. I don't know why the "\??\" shows up, but it works. If I find this is a problem I'll post a follow-up.
So if you want to repeat the above for every incorrect junction on your machine, you'll need to "cd" to the directory in question and repeat the junction command for each one.
I know some of the links show up as "symlinkd", but I didn't have any trouble deleting them and recreating them as junctions using the junction.exe tool. You can find more on Symmetric Links here. For my use, I don't really need symmetric links, so junctions will work fine. Your mileage may vary.
The only symlink I found on my system was at c:\users in the "All Users" link. I deleted and recreated it as a junction with junction.exe.
In the course of correcting my junctions, I found that I had a few areas where junctions were creating circular references. For example, if I looked at my junctions.txt file, I found that I'd have one entry that looked like this:
Directory of C:\Users\emrysx\AppData\Local\Application Data
And then the next one looked like this:
Directory of C:\Users\emrysx\AppData\Local\Application Data\Application Data
And then the next was this!
Directory of C:\Users\emrysx\AppData\Local\Application Data\Application Data\Application Data
Et cetera ad nauseam.
Now this may not be a problem due to the nature of junctions and links, but it bugged me and looked like a mess. Additionally, I couldn't see why these would be useful since I didn't have a link at the root pointing "C:\Documents and Settings\Application Data" to "C:\Users\emrysx\AppData\Roaming". Therefore it looked to me like I had messy junctions that were never going to be used.
So I deleted the "Application Data" junctions in C:\Users\emrysx\AppData\Local and C:\Users\Default\AppData\Local.
So far I haven't had any trouble with my applications or Vista as a result.
1 comment:
You shouldn't use junction.exe, but mklink (which comes with vista) instead. When using mklink you will not have issues with \??\
Also, after using mklink, you should give the +H +S +I attributes to the juntions you created using the attrib command:
attrib +H +S +I [junction] /L
The /L command is very important, as it will give the attribute to the JUNCTION ITSELF AND NOT THE TARGET.
I found out which attributes to use by comparing the junctions with other users.
The only difference I found from my junctions in comparison to other users with the default junctions is that the other users junctions will give an "access denied" when you try to access them (this is by design!). In my case, I can get into the junctions. I don't think this will be an issue though.
Ah yes. I can get into my hidden junctions because I've chosen to view hidden and operating system files and folders.
Post a Comment