Raj2796's Blog

September 28, 2011

Windows Symbolic links, Hard links, Junctions and problem accessing remotely

Filed under: MS — raj2796 @ 11:03 am

Microsoft has once again implemented more features from rival os’s, which can only be a good thing since in this case it’s Linux. Symbolic links, hard links and junctions can now be created in windows via the mklink command, older OS’s e.g. XP need to download the resource pack and grab linkd

USAGE

Mklink – vista/windows 7/ windows 2008 / windows 8

There are 3 options for mklink

  • Symbolic links – selected via the /D flag – these are like short cuts – a symbolic link to a directory is created, the default is a file symbolic link . For those of us from Linux think softlink
  • Hard link – selected via the /H flag – only for files – if you delete the hard link you delete the actual file as opposed to symbolic links where you just delete the link to the file
  • Junction – selected via the /J flag – created a directory junction i.e. hard link to a directory
For example, if you want to create a symbolic link from your appv content directory e.g. c:\AppV\content to a dev directory e.g. c:\AppV\dev you would type:
mklink /D c:\Appv\content\dev c:\Appv\dev
as shown in the below image
Linkd - only on older machines such as XP, mklink is far better

LINKD Link [/D] Target

REMOTE ACCESS TO LINKS

I suggest using a junction, they work remotely by default, however if you need to access a symbolic link remotely you can by editing the symbolic link evaluation. MS explain this on technet here – the relevant part being:

Evaluations. A user can enable or disable any of the four evaluations that are available in symbolic links. The available evaluations are:

  • Local-to-local describes a computer accessing a local symbolic link that points to a local file or folder.
  • Local-to-remote is a computer accessing a local symbolic link that points to a Universal Naming Convention (UNC) path using the server message block (SMB) protocol.
  • Remote-to-local is a computer accessing a remote symbolic link that points to a local file or folder using SMB.
  • Remote-to-remote describes a computer accessing a remote symbolic link that points to a remote UNC path using SMB.
to allow all use the command :
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
e.g:
Advertisements

1 Comment »

  1. Raj, excellent blog. Thanks, I tried junction in Windows 8 and it failed, but mklink worked!

    /Ward Christensen inventor of Xmodem & (w/Randy Suess, HW) BBSs

    P.S. Have you found any vulnerabilities in WordPress? I’d like to start blogging, too!

    Comment by Ward Christensen — January 22, 2014 @ 7:33 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: