5

I have been doing something on Unix that required a symlink. I want to port my application to Windows. Does Windows have symlinks?

EDIT: I should be more specific. I'd prefer XP. I'll install Vista if I have to.

6 Answers 6

9

Windows 2000 and later allows for symbolic linking but refers to symbolic links as junctions. I do not believe you can make them easily without an additional tool, but you can find free tools for creating them.

Free tool: http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

KB Article on Junctions: http://support.microsoft.com/?kbid=205524

1
5

On Windows pre-Vista, the best you can do is mounting a drive using the subst command which points to any directory that you want to. I've done this to eliminate the requirements on some applications that need a path without spaces.

Windows Vista included the mklink command.

1
3

NTFS 3.0 Junctions most closely represent hard links, and can only be created on directories. Junctions, like hard links, can only referrer to items on the same volume.

Additionally, NTFS allows one to mount other volumes as directories in a file system. This is similar to a symbolic link. The folder will exist if the other volume is not available, but you will receive an error if you attempt to access it in this state.

I haven't found any worthwhile use for junctions. I have used mounting other volumes. I have a USB key which I like to mount at C:\usb. This avoids me having to worry about what random letter it gets assigned to when I plug it into my Windows XP system.

Mount a drive as a path
(source: theeggeadventure.com)

2

It does in vista... kind of. See This.

2

You can create junction points in XP (See http://en.wikipedia.org/wiki/NTFS_junction_point), using the junction tool (http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx)

However I think junctions can only be created for directories (could be wrong - don't have time to do any tests sorry!)

Edit: sparks beat me to it!

0

Depending on what you're trying to achieve a simple shortcut may be all that is required. Perhaps the simplest way to create one is to right-click the file or folder and select the option to create a shortcut. It will be created inside the current folder but can be cut/copied and placed elsewhere.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .