RSS
 

Create Symbolic Links in Windows XP and Vista

02 Jun

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. The easiest way to manage junctions is with a freeware explorer add-on called NTFS Link. Windows Vista supports several types of links including symbolic links. 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.

 
3 Comments

Posted in Windows

 

Leave a Reply

 
Please leave these two fields as-is:
 
  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. Share It » Blog Archive » Creating Symbolic Links in Windows

    June 21, 2008 at 8:01 am

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