Function Reference


FileCreateNTFSLink

Creates an NTFS hardlink to a file or a directory

FileCreateNTFSLink ( "source", "hardlink" [, flag] )

Parameters

source Path of the source to which the hardlink will be created.
hardlink Path of the hardlink.
flag [optional] this flag determines whether to overwrite link if they already exist.
Can be a combination of the following:
 0 = (default) do not overwrite existing link
 1 = overwrite existing link

Return Value

Success: Returns 1.
Failure: Returns 0.

Remarks

The destination directory must already exist.

This function works only on volumes with the NTFS File system.

If the source is a file, the hardlink must be on the same volume.
If the source is a directory cross volume is allowed.

FileDelete or FileMove can be used on hardlink.

To manage the link with the explorer you can use the shell extension NTFSLink

Related

FileCreateShortcut

Example


FileChangeDir(@ScriptDir)

DirCreate('dir')
FileWriteLine("test.txt", "test")
MsgBox(0, "Hardlink", FileCreateNTFSLink("test.txt", "dir\test.log", 1))