This web page implies that it is possible to make symbolic links with relative paths using mklink
.
I have tried all sorts of ways to make relative symbolic links, but I always end up with an absolute path.
How is it done?
mklinksymbolic-linkwindows
This web page implies that it is possible to make symbolic links with relative paths using mklink
.
I have tried all sorts of ways to make relative symbolic links, but I always end up with an absolute path.
How is it done?
Best Answer
Symbolic links are relative by default. You have to explicitly write a drive letter to make any part of the link absolute.
The general syntax for a symbolic link is:
So, to create a relative symbolic link:
link
is going to be a path relative to your working directory, anddestination
is going to be a path relative tolink
.Examples:
This creates a symbolic link for
link.txt
which points todestination.txt
one folder up.You can move
link.txt
around, and it will always point todestination.txt
one folder up.This creates a symbolic link
C:\A\Link.txt
forC:\Destination.txt