Feb 7, 2011

f Comment

Creating A Soft Link on Windows PC in SECONDS!

AmazonI ran into the situation where I needed to create a soft link (also known as symbolic link) on Windows 7, but after some searching on the web it turns out NOT to be a straightforward task. In Unix you simply do 'ln -s <actual path of target file> <soft link name>'. On Windows here are two ways of doing it.

Solution #1 - BETTER
Open a command prompt window and use mklink command. If you want to soft link to a directory you execute:

mklink /j C:\soft\link\name C:\path\to\target\directory

mklink /d C:\soft\link\name C:\path\to\target\directory
The difference between /j and /d is /j creates a symbolic link while /d creates a hard link. Since you are linking to a directory you won't see any difference at all. Using the link created either way you'll be able to navigate to the destination folder and see its contents with no differences.
If you get an error saying you need admin privilege simply run the command prompt as the administrator as shown below:

How To Run Window

If you want to create a soft link to a file you do:

mklink C:\soft\link\name C:\path\to\target\file
Solution #2
Right click while dragging a target file or directory from a Windows explorer window to another explorer window and release. Then select 'create a shortcut here' to create a shortcut. Then you double click on the shortcut icon to go the target file or target folder.

However if you open a command prompt window and try to navigate to the shortcut via 'cd' you'll see an error.
Any question let me know!
Please leave a comment here!
One Minute Information - by Michael Wen
ADVERTISING WITH US - Direct your advertising requests to Michael