mklink Windows 10

What is mklink?

mklink is a keyword used to make symbolic-links between directories. Imagine that you wanted to store a directory somewhere and wanted a shortcut to access it from somewhere else. mklink would enable you to achieve this task.

Format

mklink <Option> <Link> <Target>

Link is the path where you want the shortcut/symbolic-link to be, PLUS the name of the shortcut.

Target is the path to the folder you want to link to.

Option provides three parameters to specify the type of link you want to establish.

Symbol Use
/d or /D Creates a soft symbolic link
/h or /H Creates a hard symbolic link
/j or /J Creates a Directory Junction

Example

1. Open Command Prompt

Click on the Windows symbol on the screen or press the Windows button on your keyboard to open the start-up menu. Search cmd or Command Prompt. Right-click on it and run it as administrator.

2. Write mklink

Write mklink and specify the option.

If no option is specified, then the mklink creates a soft link that points to the target by default.

Then, provide the path where you want to create the shortcut and add filename at the end of it. For example, in the above image, the path is:

C:\Users\HP\Desktop

and the filename is:

\link_to_important

Finally, add the target path where you want the link to direct you.

3. Completion

The above statement will appear if the symbolic link is created successfully.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved