I need something supported at least on Windows XP and not requiring any new user downloads hopefully.
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.
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.
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.
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!
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:
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
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
Here is also an insightful acticle on tree types of links in Windows (hardlinks, junction points and symbolic links):
It lists several other tools to create links.
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"
There's a light weight software called "Easy Symbolic Link" that makes them easy to create with a right click. Try it here:
No need 3rd party software. Just use the
.bat file :