The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,509 other followers

Windows/NTFS – this works from one file system to another: `junction -D`

Posted by jpluimers on 2014/04/20

I’m glad that junction did work to create a directory junction to link a directory from one NTFS file system to another with this small batch file (that falls back from mklink to junction):

  @echo off
:start
  if !%1!==!! goto :help
  goto :main
:help
  echo %0 TargetFolder
  echo   Creates directory symbolic link using MKLINK or JUNCTION so that TargetFolder points to %~dp0
  goto :eof
:main
  :: http://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/
  call :do mklink /D %1 %~dp0
  call :do junction %1 %~dp0
  goto :eof
:do
  echo %*
  %*
  goto :eof

Some more reading on juncions, hard links, symbolic links, etc:

–jeroen

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

 
%d bloggers like this: