No announcement yet.

Creating hardlinks and junctions

  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating hardlinks and junctions


    in some occasions I like to sync folder-structures and -content by creating junctions and hardlinks.

    This is useful on branches where only some aspects are branched from the base. Everything which should be equal to the base IS exactly the base. I don't occupy much extra disk space but still have the possibility to compare both folders without special exclusion-sets or I can compile my source without having multiple copies of needed includes ...

    What I really would appreciate is a special BC command like "copy" and "move" which could be named "clone" or "link" for example. The effect (from syncing view) would be nearly the same as with copy. The difference is that resulting files and folders are not just equal but the same.

    As work around (which would be all I need) I wanted to set up a command I could use with "open with ...". But I struggled implementing this because I can't pass any informations about the target (which would be the relative folder appended to the other sides base).

    So is there another way I could accomplish this or would you add one or both points (link-command and "other sides base") to the wishlist?


  • #2
    Hello jogi,

    Could you post an example command line call that you are attempting to perform? Please include example or actual parameter names. If you have a command line call (or a bat file that can be called from the command line), we should be able to create an Open With command that would meet your needs.
    Aaron P Scooter Software


    • #3

      on Wind-OS you don't have direct access on junctions, hard- and symbolic links. So I make use of the Link Shell Extension. With this tool I can create and control them through the Explorer.

      There is also a command line tool - ln.exe created by the same Austrian developer.

      Assume a folder comparisson of the folders SOURCE and DEST. SOURCE has a folder DIR1 which has a folder DIR2. Creating a junction for DIR2 would be done by a command like:
      ln.exe -j DEST\DIR1\DIR2 SOURCE\DIR1\DIR2
      For files the command would be:
      For recursive operations where all files should be linked without any junction on dirs:
      ln.exe -r SOURCE\DIR1\DIR2 DEST\DIR1\DIR2
      Customizing my own command I would use something like:
      ln.exe -j "DEST\%F" "%f"
      What I am missing is a way to replace DEST by a placeholder. A simple echo command also revealed that absolute paths are printed instead of relative paths (on using upper case placeholders).

      Eventually a script/batch is needed instead of a direct call so that the existence of DEST\DIR1 can be asserted.



      • #4
        Thanks for the examples. Unfortunately, we do not have a variable or method to fill in DEST for you. You could create a bat file that hard writes or somehow determines DEST.
        Aaron P Scooter Software


        • #5
          That is what I wanted to state by me initial post:
          Originally posted by jogi View Post
          But I struggled implementing this because I can't pass any informations about the target (which would be the relative folder appended to the other sides base).
          If you say that I could write a batch you mean that this batch has to get DEST by some kind of lookup or calculation, which definitely would not be universal.

          Or do I miss something and there is a way to query session information like the base folders?

          So what is your opinion about this features and what is worth to get as feature request onto the wishlist?
          • extended placeholders for "open with" to get informations about the other side
            • base
            • name of file or folder if existing
          • additional commands next to copy and move
            • one or more fixed commands like "link with junctions" and "recursive link"
            • customizable - a kind of "copy with"
              • different calls of ln.exe as in my examples
              • touch to create empty copies
              • a script to append instead of copying
              • merge, transcode sound files, alter target name, etc.

          If you look a little bit deeper the expansion of the "open with" feature will be usable for the "copy with" scenarios.