Create Symbolic Links in Windows XP, Vista and Windows 7

If you’re a *NIX guy/gal you might be tempted to bash Windows for not having symolic links. Windows has actually supported a similar feature called Junctions since Windows 2000.  A junction is not exactly like a symlink but it does work for certain types of things.  The requirement is that the drive must be formatted as NTFS (FAT doesn’t support Junctions).  The easiest way to manage junctions is with a freeware explorer add-on called NTFS Link.  NTFS Link adds a context menu to Explorer so it’s very simple to use.  You can also download a Microsoft command-line utility called linkd as part of the Windows 2003 Resource Kit Tools.

Starting with Windows Visa several types of links are supported including symbolic links using the command mlink. You can create them with a simple DOS command, however there is one trick – you must create the link as administrator. If you do not run the command as Administrator, you will get an error “You do not have sufficient privilege to perform this operation”

To create a symbolic link in Vista:

Go to Start Menu -> Accessories -> Command Prompt and RIGHT-click the icon. Select “Run as administrator” from the dialog menu. This will open a command prompt window that is running with full administrator permissions. In this window, use the following command to create a symbolic link:

mklink /d c:\mylink c:\sourcefolder

(The /d switch is used for directories. If you are linking a single file, you don’t need the /d.)

To delete links, simply use Windows Explorer. Interestingly you don’t need to run Explorer as administrator, just delete ‘em as you would any file or folder.

12 Responses to “Create Symbolic Links in Windows XP, Vista and Windows 7”

  1. Philip Daniels June 4, 2008 at 6:35 pm #

    I don’t think Junctions and SymLinks can be equated to one another. As I understand NTFS a Symbolic Link can span volumes (drives) whereas a Junction cannot under any NTFS implementation.

    What I’d like is technical reason why NTFS SymLinks are not supported on Win2000 & WinXP.

  2. Jason June 12, 2008 at 6:19 pm #

    hey philip, you’re right junctions are not exactly like symlinks but for certain uses they give you the same result.

    i just did a test on vista and created a symlink across drives. so that just might be the first useful thing vista has provided for me ;-)

    From what i have read you can make cross drive symbolic links in XP and 2000, but only to a destination filesystem that supports it – which XP and 2000 ironically do not. So theoretically you could create a symlink from XP to a Vista machine, though it doesn’t really help for normal drive mounting functionality that you get with *nix systems.

  3. Corner Cabinet  October 14, 2010 at 8:10 am #

    Windows Vista actually sucks, it is full of bugs and very unstable’”"

  4. Mike January 17, 2011 at 10:04 am #

    Anchor is broken

    • Jason January 18, 2011 at 1:25 am #

      @Mike, thanks I fixed the link

  5. Abhijith January 20, 2011 at 6:48 am #

    Is that windows xp supports creating symbolic link….? Then How to Create Symbolic in windows xp?

  6. Jerry February 24, 2011 at 10:48 am #

    on xp: linkd target_file src_file

    • ModularMix May 9, 2011 at 9:05 am #

      Do you know if it possible to create symbolic links for files instead of directories ?
      “linkd” seems to work only for directories…

  7. Johnpaul Williams April 26, 2011 at 1:59 am #

    The actual solution is to open the cmd.exe as an administrator.

    Go to your Start Menu.
    Open your Accessories folder.
    Right click on your command prompt.
    Click “Run as Administrator”

    Continue with the mlink command or mklink command you are initiating.

  8. LostChain July 27, 2011 at 6:40 pm #

    i have been tring to make a symbolic link in windows xp for ever now, i dont understand what i am doing wrong, i know in windows 7 mklink /J Movies d:\movies makes a link called Movies to link to d:\movies but when i use linkd movies d:\movies it says cannot create a link at movies i have tried other variations, by creating empty directories, to creating a file to link it to, all says the same. Is it possible that i am tring to make a link with a map network drive?

    • Jason July 27, 2011 at 8:37 pm #

      You should check that your drive is NTFS and not FAT. IF D: is a local drive then it should work – if that’s a network drive though I’m not sure you can do that. I would install NTFS Link though because it makes it much easier to manage links on XP

Trackbacks/Pingbacks

  1. Share It » Blog Archive » Creating Symbolic Links in Windows - June 21, 2008

    [...] was however before I stumbled across an interesting VerySimple Dev Blog announcement describing the creation [...]

Leave a Reply

Please leave these two fields as-is: