I know how to create a symbolic link in windows in a .bat script:
mklink /J <LinkPath> <OriginalResourcePath>
How to do the same thing in C# ?
I’ve not been happy with the googling, because i’m a beginner in C# and I probably don’t use the right terms. Anybody can indicate the API to use please ?
Warning: The question is not clear as it refers to symbolic links but at the same time refers to the /J switch that is used to create a junction. This answer refers to "how to create a symbolic link in c#" (without the /J). Instead, For creating junctions, please refer to In .NET, how do I Create a Junction in NTFS, as opposed to a Symlink?.
This is how symbolic links can be created:
This will create a symbolic link file called bar.txt on the C:-drive which links to the foo.txt text file stored in the C:\temp directory.