Skip to content Skip to main navigation Skip to footer

Circular Junction Points Cause Out of Memory Error

Problem:

Circular junction points can cause out of memory errors in Image for WIndows. A circular junction point is a directory junction that points back on itself causing an endless folder path if followed.

Solution:

Edit the permissions of all problematic circular junction points and deny List folder / read data permission for the Everyone group. This will stop the circular reference problem.

Before changing the permissions of any junction points, be aware of the following:

  • Directory junctions created by Windows should already have the correct permissions set. This issue is usually caused by incorrect permissions on third-party or user-created directory junctions.

  • Making this change will not prevent users from traversing the folder in Explorer or from the Command Prompt, but does make it more difficult. Access will be denied when trying to directly access the folder (e.g. double-clicking it in Explorer). To access a file or folder you will need to access it prior to the problem junction point (before the circular reference) or type in the path to get past the problem junction point. Note that any paths saved by programs (recently used files, etc.) will still function normally.

  • Consider if the circular junction point is actually necessary. In some cases it may not be needed or a standard folder shortcut would function just as well. The problem junction point could be removed to resolve the issue.

  • If you are unsure of the directory junctions that are causing the issue you can create a list to aid in troubleshooting and resolving the problem (see Appendix A).

  • Users comfortable with the Command Prompt may find viewing and setting the junction point's permissions simpler using it instead of the Windows GUI (see Appendix B).

Instructions:

  1. On Windows 7 open Windows Explorer. On Windows 8.x/10 open File Explorer.

  2. Browse or expand until you reach the parent folder of the directory junction you need to change. In these instructions, the directory junction being changed is Circular and the parent folder is Folder C (the Circular junction points to C:\Data\Folder A).


  3. Right-click on the folder to change and select Properties from the pop-up menu.

  4. Click the Security tab and then click the Advanced button.


  5. Click the Change permissions button in the Advanced Security Settings dialog.


  6. On the Permissions tab, if there is an existing Deny entry for Everyone (Type column shows Deny, Principal column shows Everyone), select it and then click the Edit button and proceed to the next step.

    If there is not an existing Deny entry for Everyone (or editing it is disabled), click the Add button to add it.


    If adding Everyone on Windows 8.x/10 you will need to click the Select a principal link to open the Select User or Group dialog (this isn't necessary on Windows 7 as the dialog opens directly).


    In the Select User or Group dialog, type Everyone in the Enter the object name to select box and then click OK to add it.


  7. In Windows 7, check the Deny checkbox for the List folder / read data permission, then click OK and proceed to the next step.


    In Windows 8.x/10, click the Show advanced permissions link in the right side of the dialog (link toggles to Show basic permissions after clicking it).


    Set the Type box to Deny (if you are editing an existing Deny entry this will already be set). Check the List folder / read data permission box. If you are adding the entry make sure to uncheck all the other permission boxes. Double-check these settings are correct, then click OK.


  8. Click OK on the Advanced Security Settings dialog. A Windows Security message may be displayed that you are setting a deny permissions entry. Click Yes to continue (clicking No will cancel the changes).

    Note: If you receive one or more access denied error messages the junction point most likely already has deny permissions set and is blocking the changes. You will need to cancel the changes to close the dialog. If, after reviewing the exisitng permission settings, you still need to add the deny for List folders / read data you should be able to using the Command Prompt (see Appendix B).

  9. An example of the added deny entry is shown below. If permissions for Everyone already existed you may have two items listed (one for Allow permissions and one for Deny permissions).


  10. Click OK as necessary to close out the Security Settings dialog and Properties dialog.

 


 

Appendix A — Obtain List of Junction Points

If you are unsure of the directory junctions that are causing the issue you can create a list to aid in troubleshooting and resolving the problem. The easiest method to obtain a list of all the junction points on the desired partition is by running dir /al /s from an Administrator Command Prompt and redirecting it to a file:

dir C:\*.* /al /s > E:\juncpnts.txt
(where C: is the partition from which you need the list of junction points and E: is where you want the file saved)

The first few lines of output for a standard Windows 7 partition are shown below:

Volume in drive C has no label.
 Volume Serial Number is 7091-206A

 Directory of C:\

07/13/2009  08:53 PM    <JUNCTION>     Documents and Settings [C:\Users]
               0 File(s)              0 bytes

 Directory of C:\ProgramData

07/13/2009  08:53 PM    <JUNCTION>     Application Data [C:\ProgramData]
07/13/2009  08:53 PM    <JUNCTION>     Desktop [C:\Users\Public\Desktop]
07/13/2009  08:53 PM    <JUNCTION>     Documents [C:\Users\Public\Documents]
07/13/2009  08:53 PM    <JUNCTION>     Favorites [C:\Users\Public\Favorites]
07/13/2009  08:53 PM    <JUNCTION>     Start Menu [C:\ProgramData\Microsoft\Windows\Start Menu]
07/13/2009  08:53 PM    <JUNCTION>     Templates [C:\ProgramData\Microsoft\Windows\Templates]
               0 File(s)              0 bytes

 Directory of C:\Users

07/13/2009  08:53 PM    <SYMLINKD>     All Users [C:\ProgramData]
07/13/2009  08:53 PM    <JUNCTION>     Default User [C:\Users\Default]
               0 File(s)              0 bytes

Keep in mind that the standard Windows-created directory junctions should already have the correct permissions. Checking third-party and user-created junctions would be a good place to start.

Below is output generated when the circular junction point used in this article is found. All entries aren't shown, but notice that the path keeps getting longer and longer until it either generates an error or is stopped (depending on the version of Windows).

 Directory of C:\Data\Folder A\Folder B\Folder C

09/29/2015  09:53 AM    <JUNCTION>     Circular [C:\Data\Folder A]
               0 File(s)              0 bytes

 Directory of C:\Data\Folder A\Folder B\Folder C\Circular\Folder B\Folder C

09/29/2015  09:53 AM    <JUNCTION>     Circular [C:\Data\Folder A]
               0 File(s)              0 bytes

 Directory of C:\Data\Folder A\Folder B\Folder C\Circular\Folder B\Folder C\Circular\Folder B\Folder C\Circular\Folder B\Folder C\Circular\Folder B\Folder C\Circular\Folder B\Folder C\Circular\Folder B\Folder C\Circular\Folder B\Folder C

09/29/2015  09:53 AM    <JUNCTION>     Circular [C:\Data\Folder A]
               0 File(s)              0 bytes

 

Appendix B — View or Set the Junction Permissions from the Command Prompt

To view the junction's permissions:

  • Open an Administrator Command Prompt.

  • Run icacls, specifying the directory junction path. In this example, Circular is a directory junction that points to C:\Data\Folder A.
    icacls "C:\Data\Folder A\Folder B\Folder C\Circular"

  • The output shows the currently set permissions. For example:
    Everyone:(DENY)(S,RD)
    BUILTIN\Administrators:(I)(OI)(CI)(F)
    NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
    BUILTIN\Users:(I)(OI)(CI)(RX)
    NT AUTHORITY\Authenticated Users:(I)(M)
    NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(IO)(M)


    In this output, the Deny for the List folder / read data permission is set: Everyone:(DENY)(RD)

To deny the List folder / read data permission for the junction:

  • Open an Administrator Command Prompt.

  • Run icacls, specifying the directory junction path and permission change. In this example, Circular is a directory junction that points to C:\Data\Folder A. (This command should all be on one line.)
    icacls "C:\Data\Folder A\Folder B\Folder C\Circular" /deny *S-1-1-0:(RD)

  • Program output will indicate if the change was successful or not:
    processed file: Circular
    Successfully processed 1 files; Failed processing 0 files

 

Was This Article Helpful?

0