Skip to main content
CreateSymbolicLinkTransacted function

[Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using Transactional NTFS.]

Creates a symbolic link as a transacted operation.


BOOLEAN WINAPI CreateSymbolicLinkTransacted(
  _In_ LPTSTR lpSymlinkFileName,
  _In_ LPTSTR lpTargetFileName,
  _In_ DWORD  dwFlags,
  _In_ HANDLE hTransaction


lpSymlinkFileName [in]

The symbolic link to be created.

lpTargetFileName [in]

The name of the target for the symbolic link to be created.

If lpTargetFileName has a device name associated with it, the link is treated as an absolute link; otherwise, the link is treated as a relative link.

dwFlags [in]

Indicates whether the link target, lpTargetFileName, is a directory.


The link target is a file.


The link target is a directory.


hTransaction [in]

A handle to the transaction. This handle is returned by the CreateTransaction function.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


Symbolic links can either be absolute or relative links. Absolute links are links that specify each portion of the path name; relative links are determined relative to where relative–link specifiers are in a specified path. Relative links are specified using the following conventions:

  • Dot (. and ..) conventions—for example, "..\" resolves the path relative to the parent directory.
  • Names with no slashes (\)—for example, "tmp" resolves the path relative to the current directory.
  • Root relative—for example, "\Windows\System32" resolves to "current drive:\Windows\System32".
  • Current working directory–relative—for example, if the current working directory is C:\Windows\System32, "C:File.txt" resolves to "C:\Windows\System32\File.txt".
    Note  If you specify a current working directory–relative link, it is created as an absolute link, due to the way the current working directory is processed based on the user and the thread.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.


Server Message Block (SMB) 3.0 protocol


SMB 3.0 Transparent Failover (TFO)


SMB 3.0 with Scale-out File Shares (SO)


Cluster Shared Volume File System (CsvFS)


Resilient File System (ReFS)



SMB 3.0 does not support TxF.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]


WinBase.h (include Windows.h)





Unicode and ANSI names

CreateSymbolicLinkTransactedW (Unicode) and CreateSymbolicLinkTransactedA (ANSI)

See also

File Management Functions
Symbolic Links
Transactional NTFS