none
Junction Link vs Symbolic Link

    Question

  • W7x64:  If my goal is to move the contents of C:\ProgramData\myFolder  to D:\ProgramData\myFolder  (or any other folder on the same computer; NOT on a network), and not have to make changes in programs that are accessing C:\ProgramData\myFolder, are there any differences between a Junction link and a Symbolic link of which I need to be aware?
     
    Thank you.
     

    Ron
    lundi 12 mars 2012 12:12

Réponses

  • Hi,

    Storage objects a junction references are separate directories. Symbolic links can either be absolute or relative links.

    Based on your need, there is no limitation does Junction has.

    For more detailed information about the difference between Hard Link, Junction and Symbolic Link, please refer to Hard Links and Junctions and Creating Symbolic Links.


    Hope this helps.





    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marqué comme réponse Ron Rosenfeld mercredi 14 mars 2012 10:58
    mercredi 14 mars 2012 10:23
    Modérateur

Toutes les réponses

  • Hello, I have used Symbolic links successfully in the past to do exactly as you described. I never saw a point to using junctions as they only have limitations so even when creating links locally on my PC I would still use mklink /d instead of /j.

    Make sure that when you copy files across different partitions that you will break the ACL (permissions) on the file&folder structure. If you want to keep that in tact you should use something like robocopy to transfer the files.

    The article about mklink actually shows you the exact command line option you should use for your situation:

    http://technet.microsoft.com/en-us/library/cc753194(v=ws.10).aspx 

    mklink /d C:\MyDocs D:\Users\User1\Documents

    lundi 12 mars 2012 13:14
  • On Mon, 12 Mar 2012 13:14:03 +0000, Jaap Brasser wrote:
     
    >
    >
    >Hello, I have used Symbolic links successfully in the past to do exactly as you described. I never saw a point to using junctions as they only have limitations so even when creating links locally on my PC I would still use mklink /d instead of /j.
    >
    >Make sure that when you copy files across different partitions that you will break the ACL (permissions) on the file&folder structure. If you want to keep that in tact you should use something like robocopy to transfer the files.
    >
    >The article about mklink actually shows you the exact command line option you should use for your situation:
    >
    >http://technet.microsoft.com/en-us/library/cc753194(v=ws.10).aspx  mklink /d C:\MyDocs D:\Users\User1\Documents
    >
    >
     
    Thank you for that information.  I have used both, and I note that most of the "built-in" W7 links are Junction Links.
     
    In the spirit of trying to understand things better, what limitations do Junction links have that would apply in the situation I have described?
     

    Ron
    lundi 12 mars 2012 13:45
  • Hi,

    Storage objects a junction references are separate directories. Symbolic links can either be absolute or relative links.

    Based on your need, there is no limitation does Junction has.

    For more detailed information about the difference between Hard Link, Junction and Symbolic Link, please refer to Hard Links and Junctions and Creating Symbolic Links.


    Hope this helps.





    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marqué comme réponse Ron Rosenfeld mercredi 14 mars 2012 10:58
    mercredi 14 mars 2012 10:23
    Modérateur
  • Yes, it does help.  Thank you

    Ron

    mercredi 14 mars 2012 10:58
  • Symbolic links only work in vista/win7.  Junctions work in older versions of windows.

    mercredi 14 mars 2012 14:38
  • For a better understanding of the low-level differences have a look at this article:

    http://comptb.cects.com/2268-overview-to-understanding-hard-links-junction-points-and-symbolic-links-in-windows 

    Junction Point (Directory Hard Link):

    • A file that acts like a representation of a target directory, partition or volume on the same system
    • Has the same size as the target without duplicating it (doesn’t use any space)
    • Interpreted at the operating system level – transparent to SW programs and users
    • Deleting the junction point does not remove the target*
    • If the target is deleted, its content is still available through the junction point
    • Changing the junction point contents changes the target’s contents
    • Can reside on partitions or volumes separate from the target on the same system
    • Compatible with Win2k and above in Windows

    Symbolic link (Soft Link):

    • A file containing text interpreted by the operating system as a path to a file or directory
    • Has a file size of zero
    • Interpreted at the operating system level – transparent to SW programs and users
    • Deleting the Symbolic link does not remove the target
    • If the target is moved, renamed or deleted, the link points to a non-existing file or directory
    • Points to, rather than represents, the target using relative paths
    • Can reside on partitions or volumes separate from the target or on remote SMB network paths
    • Compatible with UNIX and UNIX-like systems and with Vista and above in Windows

    mercredi 14 mars 2012 14:55
  • Thank you for that information

    Ron

    mercredi 14 mars 2012 16:21
  • ...

    Junction Point (Directory Hard Link):

    • A file that acts like a representation of a target directory, partition or volume on the same system
    • Has the same size as the target without duplicating it (doesn’t use any space)
    • Interpreted at the operating system level – transparent to SW programs and users
    • Deleting the junction point does not remove the target*
    • If the target is deleted, its content is still available through the junction point
    • Changing the junction point contents changes the target’s contents
    • Can reside on partitions or volumes separate from the target on the same system
    • Compatible with Win2k and above in Windows

    Symbolic link (Soft Link):

    • A file containing text interpreted by the operating system as a path to a file or directory
    • Has a file size of zero
    • Interpreted at the operating system level – transparent to SW programs and users
    • Deleting the Symbolic link does not remove the target
    • If the target is moved, renamed or deleted, the link points to a non-existing file or directory
    • Points to, rather than represents, the target using relative paths
    • Can reside on partitions or volumes separate from the target or on remote SMB network paths
    • Compatible with UNIX and UNIX-like systems and with Vista and above in Windows

    I don't think that's right.

    When I create a junction it never behaves as a directory hard link and it is possible to delete the target directory and be left with a junction that points to a non existent directory.

    I've never found anything in Windows that behaves like a hard link to  a directory.



    Brian G. [in the UK]

    mercredi 5 février 2014 00:41