NTLinks + NTLinksMaker: NTFS links creation and information
Moderators: Hacker, petermad, Stefan2, white
If you set level to -1, the tool will duplicate complete folder structure and create symlinks for every file, it is almost what you want. However it is impossible to have a nonzero size for a file symlink.
Perhaps I can add an option to copy standard attributes to symlinks.
I won't add any comment-managing code into the tool, sorry. So perhaps copying descript.ion files as a links is better because they will always show up-to-date descriptions... Or you can skip them using filter and then copy only descript.ion files using TC copy dialog (or some kind of script)...
Perhaps I can add an option to copy standard attributes to symlinks.
I won't add any comment-managing code into the tool, sorry. So perhaps copying descript.ion files as a links is better because they will always show up-to-date descriptions... Or you can skip them using filter and then copy only descript.ion files using TC copy dialog (or some kind of script)...
I just tried to do it with Maker 1.0.5.272 (level to "-1", with option "Symbolic links only" for link types) on some test folder with subfiles and subfolders. This created just a symlink to the selected folder.MVV wrote:If you set level to -1, the tool will duplicate complete folder structure and create symlinks for every file, it is almost what you want.
The point of making real folders and making symlinks only for files is to have access to full folder/file tree even if linked files are not available (for example because they are on removable media).
Please copy folder attributes too if possible, if you will add real folder creation (see above).MVV wrote:Perhaps I can add an option to copy standard attributes to symlinks.
OK. What about read errors handling? I see like this:MVV wrote:I won't add any comment-managing code into the tool, sorry.
tool makes catalog of e.g. CD, if it cannot read file attribules it have to try to make symlink preserving at least filename; if it can't get subfolder/filelist of some folder, only target folder with same name must be created (attributes handling like above for files); if media is not responding for X seconds and tool can't do the job for some file/folder, it should try for next folder or file in the tree and so on until the tree made in target path.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Latest version worked mostly as expected. For normal folders it's ok (targets are folders with subfolders and file symlinks inside; unfortunately, target folder attributes not copied from source), but if source is either junction or folder symlink, the target is a folder symlink too. I'd like to have options to treat a) source junctions and b) source folder symlinks like normal folders, so target will be a folder with subfolders and file symlinks inside.MVV wrote:I've just tried with NTLinks Maker 1.2.0.340, and it works as expected.
Is it possible to make a checkbox in tool's GUI like "silently ignore all read errors"? BTW read errors may happen also because of file/folder NTFS rights, illegal file name, or when they are used and locked by some process, maybe some other reasons.it may only show a error message with skip button if some folder is not readable...
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Since NTLinks Maker is a tool for creating links, it is completely by design that it stops recursion on links.I'd like to have options to treat a) source junctions and b) source folder symlinks like normal folders, so target will be a folder with subfolders and file symlinks inside.
Everything is possible.Is it possible to make a checkbox in tool's GUI like "silently ignore all read errors"?

But since it is an interactive tool, it should ask questions and let you select what to do next (skip/elevate/retry/cancel). I'll consider GUI option but I'm not sure that I will add it. You can ignore errors silently using non-interactive mode BTW.
Agree...MVV wrote:Since NTLinks Maker is a tool for creating links
... and making symlinks of files after following junctions/folder symlinks is a specific kind of "creating links" job. Maybe you can add command line switches to make tool work that way?MVV wrote:it is completely by design that it stops recursion on links.
Non-interactive mode is that what Maker does with "/q" switch? If yes, for my specific task I can use a separate button with this switch.MVV wrote:You can ignore errors silently using non-interactive mode BTW.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
I have a question regarding long path support. I created some junctions on Win7 and they seem to be kind of incompatible (with mklink):See the code above on how I created the "mklink" ones. The last two have been created using NTFS Links and NTLinksMaker (obviously).
Now to the questions: Why doesn't the creation with \??\ prefix work in mklink? Why does the same thing work in both GUI tools? Where does the prefix come from anyway? Up until today I've known only \\?\ prefix, and that's the one mentioned by Microsoft as well. Is it possible to create a valid link with the \??\ prefix via mklink?
I'm quite sure that I'm missing something, but I don't know what it is.
Note that I used an older build (1.1.0.304) of NTLinksMaker in the process; the latest version (1.2.0.340) doesn't use any prefix at all, at least for paths as short as these.
Regards
Dalai
Code: Select all
C:\Users\Dalai\a>mklink /J MachineGames_mklink \\?\E:\Profiles\Spiele\MachineGames
Verbindung erstellt für MachineGames_mklink <<===>> \\?\E:\Profiles\Spiele\MachineGames
C:\Users\Dalai\a>mklink /J MachineGames_mklink2 \??\E:\Profiles\Spiele\MachineGames
Verbindung erstellt für MachineGames_mklink2 <<===>> \??\E:\Profiles\Spiele\MachineGames
C:\Users\Dalai\a>dir
05.06.2017 16:05 <DIR> .
05.06.2017 16:05 <DIR> ..
05.06.2017 16:05 <VERBINDUNG> MachineGames_mklink [\\?\E:\Profiles\Spiele\MachineGames]
05.06.2017 16:05 <VERBINDUNG> MachineGames_mklink2 [C:\??\E:\Profiles\Spiele\MachineGames]
05.06.2017 16:05 <VERBINDUNG> MachineGames_NTFS Links [\??\E:\Profiles\Spiele\MachineGames]
05.06.2017 16:05 <VERBINDUNG> MachineGames_NTLinksMaker [\??\E:\Profiles\Spiele\MachineGames]
Now to the questions: Why doesn't the creation with \??\ prefix work in mklink? Why does the same thing work in both GUI tools? Where does the prefix come from anyway? Up until today I've known only \\?\ prefix, and that's the one mentioned by Microsoft as well. Is it possible to create a valid link with the \??\ prefix via mklink?
I'm quite sure that I'm missing something, but I don't know what it is.
Note that I used an older build (1.1.0.304) of NTLinksMaker in the process; the latest version (1.2.0.340) doesn't use any prefix at all, at least for paths as short as these.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Well, the most logical explanation is:
If you don't use the special prefix"\\?\", then the expression is resolved as a relative path.
Being at "C:\Users\Dalai\a" your current drive is C.
Creating there a link to "\??\E:\" will result in "C:\??\E:\" which is a absolute path based link.
NTFS Links and NTLinksMaker are obviously able to make relative based links ...
It seems none of them does a check for invalid characters for filenames such as ":" or "?" though.
If you don't use the special prefix"\\?\", then the expression is resolved as a relative path.
Being at "C:\Users\Dalai\a" your current drive is C.
Creating there a link to "\??\E:\" will result in "C:\??\E:\" which is a absolute path based link.
NTFS Links and NTLinksMaker are obviously able to make relative based links ...
It seems none of them does a check for invalid characters for filenames such as ":" or "?" though.
#5767 Personal license
Well, \??\ is a special prefix that is required for reparse points, it is not connected with long path prefix.
Most probably mklink simply doesn't support long paths (just like Explorer or other Windows console tools) therefore you can't create junctions with such paths. Note that there is no public Windows API for creating junctions, every tool have to fill corresponding structure and calls DeviceIoControl function.
As it was discovered, public Windows API for creating symbolic links isn't good too (it doesn't add null characters to strings so Explorer fails to show link properties), so latest NTLinksMaker versions also fill corresponding structure manually.
Most probably mklink simply doesn't support long paths (just like Explorer or other Windows console tools) therefore you can't create junctions with such paths. Note that there is no public Windows API for creating junctions, every tool have to fill corresponding structure and calls DeviceIoControl function.
As it was discovered, public Windows API for creating symbolic links isn't good too (it doesn't add null characters to strings so Explorer fails to show link properties), so latest NTLinksMaker versions also fill corresponding structure manually.
Apparently, it's not required. I can create valid junctions to the path without any prefix via mklink and the latest version of NTLinksMaker (which doesn't add prefix):MVV wrote:Well, \??\ is a special prefix that is required for reparse points, it is not connected with long path prefix.
Code: Select all
C:\Users\Dalai\a>mklink /J c:\Users\Dalai\a\MachineGames_mklink e:\Profiles\Spiele\MachineGames
Verbindung erstellt für c:\Users\Dalai\a\MachineGames_mklink <<===>> e:\Profiles\Spiele\MachineGames
C:\Users\Dalai\a>mklink /J c:\Users\Dalai\a\MachineGames_mklink2 \\?\e:\Profiles\Spiele\MachineGames
Verbindung erstellt für c:\Users\Dalai\a\MachineGames_mklink2 <<===>> \\?\e:\Profiles\Spiele\MachineGames
C:\Users\Dalai\a>mklink /J c:\Users\Dalai\a\MachineGames_mklink3 \??\e:\Profiles\Spiele\MachineGames
Verbindung erstellt für c:\Users\Dalai\a\MachineGames_mklink3 <<===>> \??\e:\Profiles\Spiele\MachineGames
C:\Users\Dalai\a>dir
05.06.2017 19:24 <VERBINDUNG> MachineGames_mklink [e:\Profiles\Spiele\MachineGames]
05.06.2017 19:24 <VERBINDUNG> MachineGames_mklink2 [\\?\e:\Profiles\Spiele\MachineGames]
05.06.2017 19:24 <VERBINDUNG> MachineGames_mklink3 [C:\??\e:\Profiles\Spiele\MachineGames]
05.06.2017 19:24 <VERBINDUNG> MachineGames_NTLinksMaker_120340 [E:\Profiles\Spiele\MachineGames]
I don't try to. I just wondered why NTFS Links and older versions of NTLinksMaker use \??\ prefix.Most probably mklink simply doesn't support long paths (just like Explorer or other Windows console tools) therefore you can't create junctions with such paths.
Apparently my initial sentence causes some irritation. It's not about long path support but the difference between \??\ and \\?\ prefixes.
Yes, that's what I found out in the meantime. But I guess there's some rules about the paths to use, isn't there?Note that there is no public Windows API for creating junctions, every tool have to fill corresponding structure and calls DeviceIoControl function.
Regards
Dalai
Last edited by Dalai on 2017-06-05, 18:28 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
It is internal prefix, of course you don't need to input it. And, reparse points have paths in two forms: substituting one that is used for resolving links (it must contain \??\ prefix but you don't see it) and printable one that is used to show link target to the user (it may contain anything, and some programs use same string for both symbolic and printable paths therefore you can see the prefix). So it isn't actually easy to say is link correct or not if you only see its printable path (you can use my NTLinks plugin to see substituting paths - it currently only reads them and writes both using same strings).Apparently, it's not required. I can create valid junctions to the path without any prefix via mklink and the latest version of NTLinksMaker (which doesn't add prefix):
So, you're saying that the input into one API function may not correspond to the output of another API function (stripping or adding the prefix in the process)?MVV wrote:It is internal prefix, of course you don't need to input it. And, reparse points have paths in two forms: one symbolic that is used for resolving links (it must contain \??\ prefix but you don't see it)
The \??\ prefix is for reparse points and has nothing to do with the long path prefix \\?\ - did I understand that correctly? What happens when I want to create a junction to a long path? Which prefix is used in this case? Does the special prefix \??\ support long paths by itself?
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Yes.The \??\ prefix is for reparse points and has nothing to do with the long path prefix \\?\ - did I understand that correctly?
So, you're saying that the input into one API function may not correspond to the output of another API function (stripping or adding the prefix in the process)?
There are no API functions that read or write reparse points (except buggy CreateSymbolicLink one), you have to fill or read structures that contain offsets to strings and strings itself. So different tools may fill or read fields differently, but link will not work if substituting path has no \??\ prefix, also it must not contain long path prefix \\?\ (long paths should be stored w/o prefix - perhaps because they are used at the kernel level where prefixes are not used).What happens when I want to create a junction to a long path? Which prefix is used in this case? Does the special prefix \??\ support long paths by itself?
I still don't understand all aspects of the whole thing, but my main question has been answered. Thanks for the explanation
! Now I can write a script based on mklink that (re)creates junctions for the profiles of all of my games (I really hate it when they dump their stuff all over the system partition).
Regards
Dalai

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror