Symbolic folder linking


  1. Posts : 62
    Windows 7 Ultimate 64 bit
       #1

    Symbolic folder linking


    Hello, I need a bit of help with creating a symbolic link between two folders. I tried mklink but it gives me incorrect syntax error. In windows 7 of course.

    I have one empty folder, C:\link\empty folder, and one folder with files in it, C:\link\files

    I want C:\link\empty folder to always point to the target C:\link\files, sounds simple but I'm not well versed at doing this sort of thing..
      My Computer


  2. Posts : 28
    Windows 7 Ultimate x64
       #2

    Easy
    Run Command Prompt with Admin rights

    Issue the command
    Mklink /j "c:/folder/files" "c:/folder/empty"

    The option /j will create the link although some swear by using option /d. I'm not sure the differences but /j works for me.
      My Computer


  3. Posts : 62
    Windows 7 Ultimate 64 bit
    Thread Starter
       #3

    habibi said:
    Easy
    Run Command Prompt with Admin rights

    Issue the command
    Mklink /j "c:/folder/files" "c:/folder/empty"

    The option /j will create the link although some swear by using option /d. I'm not sure the differences but /j works for me.
    Unfortunately this gave me an error message, Cannot create a file when that file already exists
      My Computer


  4. Posts : 62
    Windows 7 Ultimate 64 bit
    Thread Starter
       #4

    I am trying to link a normally empty folder to a folder that has files in it, So that folder A (which is empty), should simply redirect to folder B (the one with files in it). Folder A in all intents and purpose is sort of like an alias folder.
      My Computer


  5. Posts : 28
    Windows 7 Ultimate x64
       #5

    In the mklink command, you don't need to create Folder A. Once you issue the command, a shortcut (Folder A alias) is created. So, that alias is created by the command. In your case, your error is because that folder exist since you created it prior to issuing the command.
      My Computer


  6. Posts : 62
    Windows 7 Ultimate 64 bit
    Thread Starter
       #6

    Finally success! All tested and working perfectly... now I don't have to have 2 copies of the same folder and files when I log on to server 1 or 2 and it checks for the appropriate folder/files...

    The documentation is poor on the use of these commands. For instance, it does not say in the MS docs that you have to put " " quotes around both the folder locations in the command statement in order for syntax to be correct. Secondly it poorly describes where you place the folder name to be created and the hard folder (already existing) that your linking to...

    I believe it ended up working like this: Mklink /d "c:/folder/empty" "c:/folder/files". The "empty" folder was non-existent and created with the command, while the "files" folder was the actual folder with the files in it....

    Hope this makes sense...
      My Computer


  7. Posts : 28
    Windows 7 Ultimate x64
       #7

    Makes sense. That's how it worked for me.
    Specifically, I was trying to move a few of my Steam games from my harddisk (d: ) to my SSD disk (c: ).
    So I used mklink. Sorry that I wasn't clear in my explanation.
      My Computer


 

  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 07:21.
Find Us