Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Junction Points - Restore to Default in Windows

Junction Points - Restore to Default in Windows

How to Restore Default Junction Points in Windows
Published by Pyprohly
12 Apr 2016
Published by

How to Restore Default Junction Points in Windows

information   Information
Reparse points are linking mechanisms, comparable to shortcuts, that may be found throughout the Windows 7 file system. The two main types of reparse points are junction points, and symbolic links. Intended mainly for software applications� use, these objects are typically inaccessible by regular users and Windows will produce a �Location not found� error upon attempting to open one.

The �C:\Documents and Settings� resource is a classic example of a reparse point in Windows 7. Ever since Windows Vista, �Documents and Settings� is no longer a true directory and has been replaced by a junction, linking to the �C:\Users� directory. Ostensibly, these links exist for the purposes of backwards compatibility with programs that access the former locations.

While shortcut files are simply ordinary files that Windows Explorer treats specially, a reparse point operates almost transparently to most applications, effectively imitating the target object itself. As such, when unwarranted access to these junctions are gained, these advanced links may induce some badly written programs (especially those that scan the file system) into a cyclic reference. This occurs when a reparse point links to a location above itself in a folder hierarchy. For this reason, the permission settings of Windows� default reparse points should never be altered by the user.

If you are having problems with backup software not completing it may be caused by changed NTFS permissions on a specific junction.

This tutorial will enable you to repair Windows� default reparse points.

Note   Note
As a consequence of file permissions not affecting symbolic links, all default reparse points under Windows are junctions. This is by design.

Default reparse points are not inherently required for a stable Windows install and may be safely deleted.

You must have local administrative rights in order to execute the repair scripts included in this tutorial.

This tutorial supports Windows 8.1 and Windows 10, though note well that some junctions are not available by default in these newer platforms. The scripts in this tutorial do not check your version of Windows check before applying fixes.

As of later revisions of Windows 10, many default junction points have been depreciated and are absent from a fresh install. Two junctions remain in Windows 10, C:\Users\All Users and C:\Users\Default User.

The C:\ProgramData\Favorites junction is notably absent from both Windows 8.1 and Window 10.


Junction Points - Restore to Default in Windows OPTION ONE Junction Points - Restore to Default in Windows
View the Current Status of Junction Points

Note   Note
If you are unsure of which junction points, if any, have been modified, try the below batch file. This will list out each of the known default junction points and display their current security settings.

This will not alter any permissions or change any security settings.



Junction Points - Restore to Default in Windows OPTION TWO Junction Points - Restore to Default in Windows
Restore Default Junction Points

Note   Note
1. Locate and click the Download button below for the zip that corresponds with the reparse point you'd like to repair.

2. Save the downloaded file to your Desktop, and unblock it.

3. If you would like a full restoration of the junction, run only the RepairJunction_<junctionname>.bat script, otherwise,

4. If you wish to just repair the permissions for the junction, run only the PermissionPackage_<junctionname>.bat file.

5. After the program is complete you may delete the files.

 1. Restore the Default Documents and Settings Junction
Junction at "C:\Documents and Settings" linking to "C:\Users".

 2. Restore the Default ProgramData\Application Data Junction
Junction at "C:\ProgramData\Application Data" linking to "C:\ProgramData"
 3. Restore the Default ProgramData\Desktop Junction
Junction at "C:\ProgramData\Desktop" linking to "C:\Users\Public\Desktop"
 4. Restore the Default ProgramData\Documents Junction
Junction at "C:\ProgramData\Documents" linking to "C:\Users\Public\Documents"
 5. Restore the Default ProgramData\Favorites Junction
Junction at "C:\ProgramData\Favorites" linking to "C:\Users\Public\Favorites"
 6. Restore the Default ProgramData\Start Menu Junction
Junction at "C:\ProgramData\Start Menu" linking to "C:\ProgramData\Microsoft\Windows\Start Menu"
 7. Restore the Default ProgramData\Templates Junction
Junction at "C:\ProgramData\Templates" linking to "C:\ProgramData\Microsoft\Windows\Templates"
 8. Restore the Default Users\All Users Junction
Junction at "C:\Users\All Users" linking to "C:\ProgramData"
 9. Restore the Default Users\Default User Junction
Junction at "C:\Users\Default Users" linking to "C:\Users\Default"

That's all. Got a question, query, suggestion, or recommendation? Please let me know in the section below right away. Enjoy,

08 Oct 2016   #1
Layback Bear

Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64

HI Pyprohly.

Is Option 1 only a look and see.
If I understand correctly, it does not change anything.
Is that correct??

Another way to say my desire.
I would like to see what my permission are set at, compared to what Default setting are.
I'm not having any problems; I'm just curious.

Thank you for the long and hard work you are doing. Reading through many threads on this forum I have noticed that many do have problems permission.

My System SpecsSystem Spec
08 Oct 2016   #2

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan

Yeah, Option One just enables you to view the security settings for the junctions, doesn’t change anything.

Decided to add it last second. I had used it to identify the junctions I had ruined after doing extensive testing of the batch work.
My System SpecsSystem Spec
12 Dec 2017   #3

Win 7 Pro 32bit

Aloha -
I humbly thank you for a very interesting [but ultimately confusing] thread here.
Was fairly new to Win7 until recently. Using Win7 sp1 Pro 32 bit.

I had recently discovered:
C:\Users\All Users\Microsoft\Windows\Start Menu\Programs
C:\ProgramData\Microsoft\Windows\Start Menu\Programs
were the same. When I added files\folders to one it appeared in the other.

I then realized that it went back even farther to Start Menu folder.
After reading your interesting post I realized:
The entire c:\users\all users & c:\programdata folders are exactly the same!
I realize you've explained this above but I'm still trying to understand it & left pondering why?!
What's the exact purpose of the programdata folder? Here's the main reason I ask this:

I applied a well-known tweak to gain back more of the 'look & feel' of xp's start menu which got rid of 'All Programs' and added a 'Programs' flyout folder on right side of menu under the user profile picture & library links (which I also changed to point to the actual user folders on another partition).
This 'Programs' folder was actually the above mentioned Programdata....Programs folder.
At least this is where I had thought it was until the above mentioned discovery of All users Programs.

Immediately after install, I moved the libraries from C\users\profile name to D\users\profile name\[Docs . . . etc.]
I also created a PortApps folder in D\users\profile name. I then manually added shortcut from the portapps folder to the programdata...Programs folder. I wanted to see if it would create a 'flyout' menu. When it didn't, i copied the folder instead of linking it to create the menu flyout.
I later decided to delete that portapps folder from the programdata\Programs folder.
I was shocked when I discovered that it actually deleted the original PortApps folders on D\users as well?!!

Fortunately I had backups in place, but not so recent as the System C: Image. It was a shock.
I even duplicated this phenomena just to make sure it wasn't some kind of fluke.

Please forgive the length of this to get to these questions:
1. How could deleting these folders from the programdata folder also delete original folders from D\users\profile name area?
It was on an entirely different partition and a copy as well.

2. You have titled these files 'RepairJunction_xxxx'
How are we to know if these junctions are in need of repairing?
In other words, what are the logistics of how we are to determine this?
Is the bat file self explanatory? Could this have something to do with the surprise deletions?

Since then, I'm extremely leery of messing with that programdata\All users program folder!

I cannot thank you enough for this info and any further help to understand this.
My System SpecsSystem Spec

12 Dec 2017   #4

W7 home premium 32bit/W7HP 64bit/w10 tp insider ring


As youve found out the Programdata files are HIDDEN, for a good reason.
They are classified as NON USER files, bottom line for expert use only.
Simplistic explanation
These are the background master files, they also contain licence data files for products, not shown in the programfiles .

Have you found the others yet

My System SpecsSystem Spec
12 Dec 2017   #5

Win 7 Pro 32bit

Quote   Quote: Originally Posted by torchwood View Post

As youve found out the Programdata files are HIDDEN, for a good reason.
They are classified as NON USER files, bottom line for expert use only.
Simplistic explanation
These are the background master files, they also contain licence data files for products, not shown in the programfiles .

Have you found the others yet

Thank you for the input.

Not sure what you mean by 'the others', other (no pun intended) than more Junction points?
I ran 'Set' in cmd prompt and it was quite interesting.

I'm still not sure exactly what happened with the folders being deleted.
Could have been 'old-timer's disease' mixed with veteran fallout, or too much Obsidian Stout.

I've since put only shortcuts in the all users programs folder and nothing like that happened since (yet).

I'm still wondering how to tell if a repair is needed & what these repair files actually do?
From reading technet & related articles it appears as though this system is normal.
Where the programdata folder is hidden I surely can access it, unlike the others mentioned above,
where I get 'access denied' etc.

I suppose I should run the initial bat file and see what's up?
What should I be looking for (in advance)?

Thanks again m8! :)
My System SpecsSystem Spec
25 Jan 2019   #6

Windows 7 Home Premium x64 SP1

I don't see the permissions package download file, just the repair packages. I have a Windows 10 OS drive (a different PC than mine) that has a bad Application Data junction point that is replicating itself to overrun the name length restriction. I think this issue shut the drive completely down (won't boot or repair by any means but chkdsk can't find any bad sectors) so I only have command prompt access to it. If those batch files you have provided have command prompt syntax in them, I can use them otherwise I am done. I've been stymied by the system every time I try to restore the permissions (assuming that is the problem) and restore that symbolic link to reasonable content. I tried to use the ICACLS command. I discovered this junction link error by using robocopy in backup mode. It found that the Application Data link was infinitely too long. No repair program knows what to do with it including robocopy. I can chuck the whole OS and start over but it has data embedded for my wife's online work so I need to salvage it. One of the problems is the Application Data name with the blank in it. The system doesn't like the word "Data". Mostly this originates with Documents and Settings link to Users App Data directory. In that case the system doesn't like the word "and". Very frustrating!!!
My System SpecsSystem Spec

Thread Tools

Similar help and support threads
Thread Forum
Windows 7 System restore problem no restore points
I have seen numerous people are having this problem but I have not been able to find a solution that works for me. I figured I would post my own problem and maybe somebody could recommend a solution. I have been trying to use Windows System Restore on Windows 7 Home Premium. I have created...
Backup and Restore
Are Junction Points & SymLinks mirrored on cloned drive?
I have Win7 x64 Home Premium installed on a (nominal) 64GB SSD that actually is reported to have only 59.3 GB of total usable space on it. When I first installed Windows on this SSD, it only took up around 40GB total, which was great. I should've known it was too good to be true for long. :cry: ...
Hardware & Devices
Junction Points and User Accounts
I goofed and need some help! I set up a friends computer with a SSD for the C: drive and 2 mirrored HDDs for data on D:. I used a junction point to move the Users directory to the data drives. I now realize this was a bad idea. Now you cannot login. You get a message about the User Profile...
General Discussion
Many junction points broken under %userprofile%
all the junction points under %userprofile% got broken. when double-click, explorer prompts "XXXXX is not accessible". however the target folder (e.g. "%userprofile%AppData\Roaming\Microsoft\Windows\Recent") can be opened normally; at the same time the junction point can be accessible in cmd.exe,...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 22:19.
Twitter Facebook