00 Votes

Windows: Create Symlink to a File

Question by Compi | 2017-09-27 at 15:59

Is it actually also possible to create a symbolic link to a file on Windows?

On Linux, there is the command ln -s filepath for creating a symlink, but what about the operating system Windows? Is it also possible there? Obviously, Windows does not know the command ln, I always get the error message "The command ln is either misspelled or could not be found.".

ReplyPositiveNegative
0Best Answer0 Votes

You can create symbolic links also on Windows. However, command and syntax are differing from Linux. On Windows, you are using mklink instead of ln.

mklink C:\path\to\symlink C:\path\to\file

After mklink, first you have to specify your desired symlink and then you have to pass the linked file respectively the target.

If you want to connect to folder with a symlink, you have two pass of the parameter /d additionally:

mklink /d C:\path\to\symlink C:\path\to\folder

By default, mklink is creating a file symbolic link. With /d, you are able to create a directory symbolic link.
2017-09-27 at 16:58

ReplyPositive Negative
Reply

Related Topics

Rename File to its Folder Name

Tutorial | 0 Comments

PHP: File Download Script

Tutorial | 0 Comments

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.