36

I need something supported at least on Windows XP and not requiring any new user downloads hopefully.

2

12 Answers 12

112

Have you looked at Junction?

Also, Windows Vista introduced the mklink command line tool to create symbolic links.

MKLINK [[/D] | [/H] | [/J]] Link Target
    /D      Creates a directory symbolic link.  Default is a file
            symbolic link.
    /H      Creates a hard link instead of a symbolic link.
    /J      Creates a Directory Junction.
    Link    specifies the new symbolic link name.
    Target  specifies the path (relative or absolute) that the new link refers to.

Scott Hanselman has a write-up on it at http://www.hanselman.com/blog/MoreOnVistaReparsePoints.aspx.

If you're speaking solely about Windows XP, I've only ever used the Junction tool.

5
  • 4
    Looks like another option could be the /J switch on mklink (like "mklink /J <JUNCTION> <DIR>"). Note that it isn't a separate executable, it is a command in cmd so if you're calling from PowerShell, you'll have to shell out to cmd (i.e. "cmd /c mklink /J <JUNCTION> <DIR>") May 10, 2011 at 19:14
  • Wow junction works great. It creates a real symbolic link so even Cygwin will follow it.
    – styfle
    Sep 19, 2011 at 19:20
  • 3
    mklink was exactly what i was looking for.
    – prolink007
    Feb 14, 2014 at 17:49
  • 2
    Why oh why did they reverse the order of the arguments from the age-old UNIX ln command?
    – kbolino
    Feb 11, 2016 at 15:23
  • 1
    @kbolino: Easy! Because they simply expect the open-source world to "catch-up" with them... ugh.
    – tniles
    May 18, 2016 at 15:55
23

There is a tool called Link Shell Extension which makes it easy to create symlinks to files, as well as an older type of link called a "Junction" (basically, a symlink to a folder) as well as many more exotic types of links.

enter image description here

Basic usage is simple: Navigate to the source folder, right click on the file or folder you want to link to, and choose the new "Pick Link Source" option from the context menu. Then go to the folder where you want to drop the link, right-click, and select "Drop As" and then either "Symbolic Link" for files or "Junction" for folders.

but

BEWARE: One reason Microsoft makes it hard to do this is that junctions and symlinks can make it very easy to accidentally DELETE CRITICAL FILES!

In some versions prior to Windows 7, deleting a junction or symlink in Explorer would automatically DELETE THE ORIGINAL DIRECTORY as well!

I believe that this problem has now been solved... but of course I make no promises... be particularly careful with third party file browsers (if you're to the point of needing symlinks, I'm sure you're painfully aware of how hard the Windows 7 Explorer blows.)

But I digress. My point is: be careful, do your homework and read the LSE documentation to find out how junctions and symlinks really work, and for gawd's sake BACK EVERYTHING UP before you start messing with junctions and symlinks!

0
9

the referenced directory should work as if it had actually been added to %PATH%, right

No, if you had C:\bin added to your %PATH% and inside c:\bin you created a Junction called c:\bin\anotherDir\ to point to c:\anotherDir\ so that you could run some.exe from the command line like:

> anotherDir\some.exe

This would not work since the %PATH% variable does not work with sub directories (symlinked or not)

you would need to create a hardlink directly to some.exe, so the hardlink c:\bin\some.exe points to c:\anotherDir\some.exe

So in summary I don't believe you can do exactly what you are asking. That said I do recommend Link Shell Extension for creating Junctions and hardlinks. It offers more capabilities than most junction tools in a very easy to use windows explorer extension

7

Try Symlinker a GUI tool to create Symlink in Windows

This application needs .Net Framework 3.5 to run (SP1 recommended) and as of 4/24/2015 this software will only work under

  • Windows Vista
  • Windows 7
  • Windows 8 and 8.1

Symlinker UI

1
7

NATIVE Windows Vista, 7, & 8 COMMAND:

  1. File Symbolic Link (default):
    • mklink <oldpath> <newpath>
  2. Directory Symbolic Link:
    • mklink /D <oldpath> <newpath>
3
4

I don't think the version of NTFS that comes with XP supports symbolic links. NTFS6, which ships in Vista and Windows 7, supports symbolic links with the mklink command. The XP version of NTFS does support hardlinks, but these cannot span volumes.

3

Create symlink in Far Manager: Alt+F6 or F7.


Here is also an insightful acticle on tree types of links in Windows (hardlinks, junction points and symbolic links):

https://translate.google.com/translate?hl=&sl=ru&tl=en&u=https%3A%2F%2Fgeektimes.ru%2Fpost%2F50878%2F

It lists several other tools to create links.

0
2

Junction is a great utility but one thing to watch for is that junction points look exactly the same as ordinary folders in Windows Explorer.

Use 'junction.exe -s' on the command line to list all junctions in folders and sub-folders.

1

No need 3rd party software. Just use the .bat file :

https://puvox.software/blog/easiest-method-create-symlink-symbolic/

0

I used and recommend Junction tool from Microsoft SysInternals: http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

Example using cmd.exe:

junction c:\Program-Files "c:\Program Files"
0

There's a light weight software called "Easy Symbolic Link" that makes them easy to create with a right click. Try it here:

https://blog.afach.de/?page_id=589

0

There is an open-source tool called SymlinkCreator that provides a minimal UI for drag-n-drop both files and folders to be symlinked. It can use both relative paths (if in the same drive) or absolute paths for symlinking. There is an option to retain the script used for symlinking.

enter image description here

Disclaimer: I am the author of SymlinkCreator. I created it for my personal use but then shared it with everyone.

1
  • Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.
    – DavidPostill
    Apr 1, 2021 at 21:08

You must log in to answer this question.

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