Windows Vista added the ability to create symbolic links to files and directories. How do I create a symbolic link and what are the current consumer and server versions of Windows that support it?
|
|
You can create a symbolic link with the command line utility
Symbolic links are supported on NTFS file systems only and are available in Windows Vista, Windows Server 2008 and Windows 7. Future Windows operating systems are likely to continue support for this command. You can read further information about this new feature on Microsoft TechNet, Junfeng Zhang's blog or howtogeek.com. |
|||||||||||||
|
|
On Windows XP you can use
Keep in mind fsutil will only work if both are on same drive |
|||||
|
|
Use mklink or junction from Sysinternals (Microsoft). I believe mklink will work in Windows 2000 and above, but I cannot find any hard documentation on that. junction is for Windows 2000 and above. |
||||
|
|
One small thing, if you are using Powershell, mklink does not work directly, run it like this:
|
||||
|
|
|
Didn't see this in any of the answers, but linkd.exe (in the Windows 2003 Resource kit here) allows you to create junctions, which pretty much function as a soft/hard link does in Linux. Junctions are available from Windows 2000 and up, so just copy linkd.exe to the target system and it should work. |
|||
|
|
|
See TechNet entry. I believe it is a Vista/Server 2008 and up feature. |
|||
|
|
If you are still on old Windows, like XP, 2000, 2003, etc., try NTFS Link. I use it a lot. You get a shell link right click menu option to create a junction point. Excellent stuff. |
|||||
|
|
To make sure your links work you might want to check the configuration of your server. Links can be made but unless you use the symlinkevaluation setting in the following command your links might not work.
See also http://technet.microsoft.com/en-us/library/cc754077%28v=ws.10%29.aspx. By default only the local options are activated. |
|||
|
|