Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

June 07, 2007 12:00 AM

How do I create symbolic links in Windows Vista?

Windows IT Pro
InstantDoc ID #96209
Rating: (1)

A. Windows Server 2008 and Windows Vista provide the Mklink utility, which creates both file and directory symbolic links. The command has three optional parameters: /D creates a directory symbolic link instead of the default file symbolic link, /H creates a hard link instead of a symbolic link, and /J creates a directory junction.

Suppose you have calc.exe in the windows\system32 folder, and you want to run it as addup.exe instead. You can use the command

mklink addup.exe calc.exe
symbolic link created for addup.exe > calc.exe
C:\Windows\System32>dir addup.exe
Volume in drive C has no label.
Volume Serial Number is E0BA-564B
Directory of C:\Windows\System32
05/17/2007 11:08 AM addup.exe [calc.exe]
1 File(s) 0 bytes
0 Dir(s) 235,354,234,880 bytes free

Notice that the directory entry shows a symbolic link with the real file name in square brackets. Using /H instead and creating a hard link makes the entry appear as if it's actually the file instead of looking like a shortcut, which is what you get by default. For example, in the output below, you see a standard symbolic link and then a hard link, which appears exactly like a normal file:

mklink /H addup2.exe calc.exe
Hardlink created for addup2.exe > calc.exe

dir
05/17/2007 11:10 AM addup.exe [calc.exe]
11/02/2006 10:00 AM 188,416 addup2.exe
11/02/2006 10:00 AM 188,416 calc.exe

For folders, you essentially have the same symbolic link and hard link options, and with folders a hard link is known as a junction point, created with the /D and /J switches respectively. With either type of link, you can navigate the folders, and any added/deleted content will update the target folder:

mklink /d testlnk test1
symbolic link created for testlnk > test1

mklink /j testlnkhd test1
Junction created for testlnkhd > test1

dir
05/17/2007 11:20 AM

test1
05/17/2007 11:21 AM testlnk [test1]
05/17/2007 11:21 AM testlnkhd [D:\temp\test1]

Related Content:

ARTICLE TOOLS

Comments
  • BERNARD
    5 years ago
    Jun 21, 2007

    Does mklink on Vista replace the old linkd in XP? I can see a lot of overlap, and that linkd is not available on Vista.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.