Categories: Files

Create symbolic link

Like in Linux, we can create symbolic links in Windows OS also. There’s an inbuilt command called ‘mklink‘ using which we can create symbolic links.

The commands are explained below with examples.

Create a symbolic link to a file:

The syntax for creating a symbolic link to a files is as follows.

mklink LinkFile TargetFile

For example, to create a symbolic link from user’s Desktop folder to “C:\Program Files (x86)\Microsoft Office Communicator\communicator.exe”, the command is

mklink C:\users\wincmd\Desktop\communicatorLink.exe C:\Program Files (x86)\Microsoft Office Communicator\communicator.exe"

In the above command communicatorLink.exe is the name of the symbolic link. “C:\Program Files (x86)\Microsoft Office Communicator\communicator.exe” is the target for the link.

Create symbolic link to a directory:

Syntax for creating symbolic link to a folder is as follows.

mklink /D linkfile TargetDirectory

Example:
Create a symbolic link from C:\ folder to user’s Documents folder

mklink C:\Docs C:\Users\wincmd\Documents

Create a hard link

mklink /H link  target

Create a junction point

mklink /J junction target
Srini

View Comments

Share
Published by
Srini

Recent Posts

Add new user account from command line (CMD)

Adding users from command line is much easier than going through the UI. It saves…

4 years ago

Delete directory from command line [Rmdir]

Do you want to delete a directory from Windows command prompt(CMD)? This post explains how…

4 years ago

TaskKill: Kill process from command line (CMD)

We can kill a process from GUI using Task manager. If you want to do…

4 years ago

Kill Chrome from command line

Chrome is definitely the stable browser compared to other ones and it has been my…

4 years ago

Find windows OS version from command line

Windows has multiple command line utilities that can help find the version of the Windows…

4 years ago

How to check if Windows 32 or 64 bit?

There are multiple ways to check whether a Windows computer is running 32-bit OS or…

7 years ago