By Achilles Hill | Last Updated
If you are interested in how to use mklink command on Windows 10, follow this article which will show you what is the mklink command and list four usages of the mlink command.
The mklink command is a command that comes with Windows, and it can be used in Win 10, as well as in earlier systems such as Win 7, Win Vista, Win 8, and Win 8.1. However, if you use it on systems other than Win 10, you must have administrator privileges, or you will be prompted with "You do not have sufficient privileges to perform this operation". Of course, Windows 10 sometimes requires administrator privileges as well.
Open the command prompt, type mklink /? on the Command Prompt window, then press Enter. The system lists the usage of the mklink command.
For the ease of my example, I created two folders on my D drive under the Simple folder: the Link folder, and the Target folder.
Nothing with parameters is the default creation of file symbolic links. The use of this command requires administrator privileges, so you must run the command prompt as administrator.
Type the following command and press Enter: mklink d:\Simple\Link\text.txt d:\Simple\Target\text.txt.
At this point, we open the Link folder and we see a shortcut-like file appear below:
But this text.txt is not a shortcut, it's a symbolic link, we can open and use it normally under the Link folder, but the file is stored under the Target folder. This is just like having two identical files in two different folders, and editing any one of them will change both of them at the same time.
Also, this one is a command line that requires administrator privileges. Type the following command and press Enter: mklink /d d:\Simple\Link\Target d:\Simple\Target.
At this point, we will notice an additional Target folder under the Link folder:
This is not a shortcut, it is a virtual folder. Open the new Target folder, you will find that and the real storage location of this folder is d:\Simple\Target, so you can also store files in the Link\Target directory without taking up space in this folder.
This command requires to use of the /j parameter and is very similar to the second command, but this command does not require administrator privileges.
Type the following command and press Enter: mklink /j d:\simple\link\new d:\simple\target.
A new folder with a shortcut corner appears under the Link folder:
Then we open the new folder and find that the storage path in the properties is the same, as if the new folder exists here, which is not the same as /d. The new folder is still stored in the original d:\simple\target location.
The three commands above still have the shortcut corner markers, and you'll notice a difference in the results of the following command.
The hard link still doesn't require administrator privileges, just type in the command with the /H parameter and press enter: mklink /h d:\Simple\Link\new.txt d:\Simple\Target\text.txt.
Then a new.txt will appear in the Link folder without a shortcut corner, and it looks like a file.
If you modify new.txt, you will find that the contents of the original text.txt will be changed at the same time.
I believe you should understand how to use the mklink command by my example. This command is still very useful, we can "virtualize" files or folders to other directories. Especially when there is not enough space on the C drive, you can "virtualize" a file or folder on the path corresponding to the C drive, so that you can move some folders or files that are stored on the C drive by default to a partition with more space such as D drive.
However, it should be noted that not all folders on C drive can be handled in this way, especially system folders, which are sometimes prone to errors and must be used with caution!
Related Articles: