Kernel32CreateSymbolicLink Method

Creates a symbolic link.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static bool CreateSymbolicLink(
	string dstPath,
	string srcPath,
	SymbolicLinkFlags flags
)

Parameters

dstPath  String
The path of the symbolic link to be created.
srcPath  String
The path of the target for the symbolic link to be created.

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

flags  SymbolicLinkFlags
Indicates whether the link target is a file or is a directory.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also