MKLINK – Create and Use Links in Windows

Page 13 of 16 FirstFirst ... 31112131415 ... LastLast

  1. Posts : 925
    Windows 10 Pro
       #120

    GoKay -
    Create a symlink to the new location from the old one so any calls to the program gets re-directed to the new one seamlessly
    What you mentioned is what I want to do; the target folder is simply an acronym of the source folder, but it still doesn't work ? Same error; cannot create a file when that file already exists.

    Kado -
    I think your problem may be that the target folder already exists. I think if you are trying to create the junction C:/test/target then only c:/test can exist.
    That doesn't explain why, if I give the target folder a name such as CPS, it still doesn't work ?

    I may see the problem, the target folder is C:\Users\...\.. etc; but the source folder is C:\CustomFiles, is there a way to link despite the fact that the target folder has a different name ?
      My Computer


  2. Posts : 5,656
    Windows 7 Ultimate x64 SP1
       #121

    Then you have to move the folder (or delete old one after copy) to the new location, not copy alone. Then the symlink has to be created at the old location with the same name that directs to the new location (which can be same or different named).
      My Computer


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

    OK. Here is a worked example...

    Prior to mklink

    -2015-09-23-002.png

    The command.

    -2015-09-23-001.png

    The result

    -2015-09-23-003.png
      My Computer


  4. Posts : 925
    Windows 10 Pro
       #123

    GokAy said:
    Then you have to move the folder (or delete old one after copy) to the new location, not copy alone. Then the symlink has to be created at the old location with the same name that directs to the new location (which can be same or different named).
    I don't follow ?

    If the target is at C:\Users\subfolder\subfolder\etc and the source is at C:\AcmeForever (example folder)

    mklink /j <target> <source> doesn't work; neither does mklink /d <target> <source>
      My Computer


  5. Posts : 925
    Windows 10 Pro
       #124

    I can't link the main directory and have all sub-directories automatically link as well; I must create a symbolic link for the directory, including sub-directories ?

    Target Directory: C:\users\<foldername>\<foldername>\<foldername>\<foldername>
    Source C:\AcmeFiles\
      My Computer


  6. Posts : 5,656
    Windows 7 Ultimate x64 SP1
       #125

    Ok, I will try to be explicit:

    I have some program at D:\programs\my_app
    I want to move the folder "my_app" to another place (say to E) but keep my current shortcuts etc working
    Then I would:
    Move the folder my_app to E (so it is now at E:\my_app)
    There is no my_app folder at the original location (D:\programs)
    run the command:
    Code:
    mklink /d "D:\programs\my_app" "E:\my_app"
      My Computer


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

    That will work except /d gives a symbolic link /j a junction. They are similar in function.
      My Computer


  8. Posts : 5,656
    Windows 7 Ultimate x64 SP1
       #127

    I guess junction should be on the same partition?
      My Computer


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

    No it works across local drives. I've just tried it.
      My Computer


  10. Posts : 2
    Windows 7 Professional x64 SP1
       #129

    Moving C:\Users


    Hi Kari, many thanks for the great tutorial. Is it a wise thing to move the whole c:\users folder to another local volume e.g. d:\users and make a directory junction in Win7 in order to relocate user data easily? Thank you.
      My Computer


 
Page 13 of 16 FirstFirst ... 31112131415 ... 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 02:16.
Find Us