I would like to create a shortcut to some directory which I can use in Windows console with a cd
command. So I create a directory symbolic link:
mklink /D link_name c:\some\path
/D
is for a directory symbolic link (default is a file symbolic link)
Let's say I have created the link link_name
in my user's home directory: c:\Users\user\link_name
.
I can then use that link with the cd
command:
c:\Users\user> cd link_name
c:\Users\user\link_name>
The only problem is the resulting path. I simply need to have the resulting path the same as symbolic link's target, i.e. c:\some\path
from my example, but it's c:\Users\user\link_name
instead.
So the directory symbolic link is rather a directory alias than a shortcut.
What I need:
c:\Users\user> cd link_name
c:\some\path> cd ..
c:\some>
How the directory symbolic link actually works:
c:\Users\user> cd link_name
c:\Users\user\link_name> cd ..
c:\Users\user>
Is there any way to achieve what I need? I prefer some file system object over defining an environment variable, etc.