MKLINK – Create and Use Links in Windows

Page 9 of 16 FirstFirst ... 7891011 ... LastLast

  1. Posts : 17,545
    Windows 10 Pro x64 EN-GB
    Thread Starter
       #80

    Pyprohly said:
    Kari said:
    Your mklink command has no switches, meaning that Windows thinks it is a symbolic link (a folder).
    Slight mistake there, Kari.
    Could you please explain my mistake?
      My Computer


  2. Posts : 10,455
    Microsoft Windows 7 Home Premium 64-bit Service Pack 1
       #81

    Pyprohly said:
    Kari said:
    Your mklink command has no switches, meaning that Windows thinks it is a symbolic link (a folder).
    Slight mistake there, Kari.
    Yes. Without any switches it is a file symbolic link. https://technet.microsoft.com/en-gb/.../cc753194.aspx
      My Computer


  3. Posts : 17,545
    Windows 10 Pro x64 EN-GB
    Thread Starter
       #82

    I stand corrected, begging you geeks to forgive me. My point was and is that I see no reason to use symbolic links to anything else than folders. With a file it's always better to use a hard link. Of course if you can tell a reason why you should use a symlink instead of hard link?

    Anyway, as I am apologizing a bad choice of words, I am at the same time amused that no one could spot that the OP had the link and the target switched. The OP has now been given a working command.
      My Computer


  4. Posts : 10,455
    Microsoft Windows 7 Home Premium 64-bit Service Pack 1
       #83

    A Symlink can be used across volumes a hard link can't.
      My Computer


  5. Posts : 17,545
    Windows 10 Pro x64 EN-GB
    Thread Starter
       #84

    OK, again I stand corrected. That's true and a reason good enough to use it if the link and the target are on different volumes.
      My Computer


  6. Posts : 925
    Windows 10 Pro
       #85

    Wait, maybe I forgot to mention something, I want to make a hard like from a file to a directory same command ?

    mklink /h <absolute path of the file> <absolute path of the target directory> ?
      My Computer


  7. Posts : 10,455
    Microsoft Windows 7 Home Premium 64-bit Service Pack 1
       #86

    mklink /h <path to link name> <path to real file>

    I think.
      My Computer


  8. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #87

    Kari said:
    I see no reason to use symbolic links to anything else than folders. With a file it's always better to use a hard link. Of course if you can tell a reason why you should use a symlink instead of hard link?
    Yes, I can list three, three of the biggest reasons why one would fancy a symbolic link over a hard link: (in decreasing order of interest)
    • Symbolic links are the only links that support relative paths as targets;
    • Symbolic links can link across partitions, unlike hard links which cannot;
    • Symbolic links can point to a non-existent target (mega useful if you want to allow the target's data to change whenever, without having to re-create the link).
    Kari, I feel that hard links and junctions are obscuring the power of symbolic links in this tutorial of yours. Symbolic links should really be the type of link in the lime light; symbolic links should be the links that deserve to be demonstrated in a tutorial.

    With all due respect, I strongly recommend that you add a table to the tutorial, Kari, one that summaries the benefits and disadvantages of the types of links: what links have support for files/folders?; what version of Windows is the link supported in?; can I link across hard disks using this link?. Certain links are simply better for certain situations, there's no denying that.


    Kari said:
    I am at the same time amused that no one could spot that the OP had the link and the target switched. The OP has now been given a working command.
    Are you referring to Jerome's command line:
    Code:
    C:\Windows>mklink C:\Users\....\....\....\....\.....\...\<individual file> C:\1
    If so, maybe we did, maybe we didn't spot that. In any case, you could not have concluded that "C:\Users\....\....\....\....\.....\...\<individual file>" was Jerome's intended target and "C:\1" was where his link should be created. Facing it, there are many things wrong with "mklink C:\Users\....\....\....\....\.....\...\<individual file> C:\1" that it just wouldn't be in good interest to help 'OP' at this stage, until 'OP' can clarify his objective.


    JerometheGiraff said:
    Wait, maybe I forgot to mention something, I want to make a hard like from a file to a directory same command ?

    mklink /h <absolute path of the file> <absolute path of the target directory> ?
    No. Hard links have no support for folders. You must use a symbolic link or junction point instead.
    Last edited by Pyprohly; 10 Jul 2015 at 10:26. Reason: Fixed typos and corrected some jargon
      My Computer


  9. Posts : 5,656
    Windows 7 Ultimate x64 SP1
       #88

    Just wanted to add: Symbolic links turn into normal folders with copies of contents of the linked folder when copied to another place. Is there a way to avoid this? Learned this while we had a discussion in a thread recently.
      My Computer


  10. Posts : 925
    Windows 10 Pro
       #89

    I'm going to reiterate. I want to create a symbolic link whereas I create a symbolic link to a file, when the file in the symbolic link location gets updated, or the original location, either way both files get updated. In laymen terms, the file in the original location gets cloned; when I save the file in the cloned location, both the cloned file and the location of the original file get updated.

    It has been informed that I must use a symbolic link for what I want to do personally;

    mklink /d <absolute path of source location FILE> <absolute path of target location DIRECTORY\FOLDER>

    The above command is not working ?
      My Computer


 
Page 9 of 16 FirstFirst ... 7891011 ... LastLast

  Related Discussions
Our Sites
Site Links
About 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 14:58.
Find Us