Making Links and Junctions

A link in general terms is a file or folder that points, or redirects to another file or folder. Windows supports four distinct types of link:

 

Note that hard links, soft links and junctions are only supported on NTFS-formatted drives. 

 

Windows (particularly in Vista and above) uses links and junctions quite a lot. If you turn off the Hide protected operating system files option on the Folders / Global Filters page in Preferences, you will notice several folders appear in red in various locations (the root of C: for one, and your user profile folder). Microsoft uses these hidden junctions to maintain backwards compatibility with software that has hard-coded the names of legacy paths. For example, in Windows XP, user data is stored in C:\Documents and Settings, but in Vista and above it's in C:\Users. By default Windows creates a hidden junction called Documents and Settings that points to the new User folder, so that software that specifically references the old path will still operate.

    junction targets.png 
 

If you turn on the Description column in a Lister you can see the target of links and junctions. See the Folder Options section for information on adding columns to the display.

 

Opus is able to create all these types of links for you. Creating a shortcut is the simplest, and you can do this in Opus just as you can in Explorer, either by:

 

Aside from basic shortcuts, other types of links and junctions are generally used only rarely and by experienced users (at least on Windows). If you are not familiar with how they work, be careful and test with copies of both target and source folders first. Be aware that most actions in most software are not "link aware". For example, be careful when deleting or overwriting links that you are not deleting or overwriting the things they point to, unless that is your intention. Test how the things behave first before risking important data!

Commands to create the other types of links and junctions can be found in the default toolbars under the Copy Files button's menu, within the Create Advanced Links sub-menu:

Create Advanced Links menu

Like the main Copy Files button itself, the menu items work between dual file displays, taking the selected items in the source folder and creating junctions or links in the destination folder which point to them.

Behind the default menu items is the internal Copy command, which is used to create shortcuts as well as the other types of links. For example, you the command to create a button or menu item to create soft links in the destination folder to selected files in the source is: Copy MAKELINK=softlink.

 

When creating soft links, there are two ways the target of the link can be stored:

 

See the documentation on the Copy command for more information, and the Customize section for information on how to configure buttons and hotkeys. You may also like to see the File Types Drop Menu page - it's possible to add commands to the drag-and-drop menu, and you could, for example, add a Create Softlink command to go along with the Create Shortcut command that already appears on this menu.
 

        Drop menu - results.png