📜 ⬆️ ⬇️

Windows links, symbolic and not only

Prehistory


In his topic " Impressions of Yandex.Subbotnik ", the absolvo habrachelok expressed surprise that one of the speakers did not know that there were symbolic links in Windows. Honestly, I did not know this either, so I asked about these links in the comments .

I think that what has been found out may seem useful to someone.


Immediately make a reservation that under the links in Windows, I understand the links in NTFS. In FAT, the link mechanisms, as far as I know, were not provided.
')
The Windows kernel supports the following types of links:
If you have never dealt with symbolic and hard links, but would like to know about them, I advise you to read an excerpt from the documentation of the FAR file manager , thanks to the harachelodek allemeine . It says only about Hard Links and Junction Points, but this is quite enough. Symbolic Links act the same as the Junction Points, with the difference that they can point to files (and are implemented in Windows differently).

Hard Links can be created only for files, Junction Points - only for directories, Symbolic Links - for files and directories. In the future, “hard links” means Hard Links, “symbolic” - Junction Points and Symbolic Links.

Hard links are valid within the same section, symbolic links can cross section boundaries. In this connection, symbolic links may break if the structure of sections is changed.

Not with everything that is supported by the kernel, the explorer is able to work normally. Be careful when using Junction Points in Windows versions prior to Vista. When deleting a Junction Point, the explorer can climb inside the directory referenced by Junction Point and delete everything there, and then delete the Junction Point, although it only has to remove the link. Surely there may be problems when moving or copying Junction Points.

I don’t know if standard versions like rmdir belong to Junction Points in Windows versions up to Vista.

Additional materials on the topic


I will note an English-language article that describes the nuances of using links and some programs that allow you to work with them. The article is outdated, so it says only about Hard Links and Junction Points (and the latter in the article are often referred to as symbolic links ...).

According to habracheloveka SamDark , a good description of all kinds of links is still in the help on the NTFS Links (add-on for Total Commander, see below).

Soft


Now you can go to the review of programs for working with links. Yes, yes, if you do not use FAR (see below), you will need separate programs. All programs listed below are free.

Microsoft Utilities

Windows> = Vista

In Windows Vista, the mklink added to create symbolic and hard links (thanks for the information to haborochelovek metamorph ).

Windows> = 2000

fsutil hardlink create

Creates a hard link to the file ( source ).

linkd

Creates a junction point on the directory ( source ). The utility is included in the Microsoft Windows Resources Kit .

Extensions for Explorer

NTFS Link integrates into Explorer and adds to the pop-up menu that appears after dragging with the right mouse button, the items “Create junction point” and “Create hard link”. In addition, it intercepts calls to Explorer, ensuring the normal movement / copying / deletion of generated links.

NTFS Links (not to be confused with the add-on for Total Commander, see below) is an absolutely similar program. Thanks for the comment habrachelovek vpbar .

I recommend : Link Shell Extension - a similar program with advanced functionality and a very detailed description. Thanks for the comment habrachelovek versia .

NTFS Links - add-on for Total Commander

Program page (for information thanks to habrachelovek SamDark ). The plugin can be launched as a separate program, outside of Total Commander.

FAR

The FAR console file manager has long supported Hard Links and Junction Points out of the box. To create a link, use the Alt-F6 shortcut ;-) Thank you for commenting to habrelovek 4xis .

Junction link magic

Junction Link Magic is a GUI program for creating, modifying and modifying Junction Points. Thanks for the comment habracheloveku vady .

Junction - a console program for creating Junction Points

Junction is better than linkd because you don’t need to drag the entire Resource Kit :-) Thanks for the comment habrachelovek corp .

UPD : updated the topic with comments.

Source: https://habr.com/ru/post/50878/


All Articles