≡ Menu

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

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
1 comment… add one
  • God

    Actually, mklink does not exist on Server 2003.

Leave a Comment