title: Creating junctions in Windows for Hudson build
body: <p>I have a job in Hudson that builds on a Windows XP slave. I know that symlinks are not possible (directly) in Windows XP, and so I am trying to use junctions instead. I wrote a batch script:</p>
  
  <pre><code>@echo off
  if "%1" == "" goto ERROR1
  if "%2" == "" goto ERROR2
  goto create
  
  :create
  echo Creating junction for %1 at %2
  if exist %2 junction -q -d %2
  md %2
  junction -q %2 %1
  goto :eof
  
  :ERROR1
  echo Source directory not specified
  goto :eof
  
  :ERROR2
  echo Destination directory not specified
  goto :eof
  </code></pre>
  
  <p>In my job, when I call this script, it hangs at the line <code>echo Creating junction for %1 at %2</code>. This is my Hudson "Execute Windows Batch Command":</p>
  
  <pre><code>call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64
  
  copy C:\Data\Scripts\slink.bat .
  call slink.bat C:\Data\3rdParty64 3rdParty
  call slink.bat %WORKSPACE%\..\..\..\tds.core\label\%label% tds.core
  </code></pre>
  
  <p>...and this is the output:</p>
  
  <pre><code>C:\Data\Hudson\dev\workspace\Common_Windows\label\DFWW9202&gt;call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64 
  Setting environment for using Microsoft Visual Studio 2010 x64 tools. 
  
  1 file(s) copied. 
  Creating junction for C:\Data\3rdParty64 at 3rdParty
  </code></pre>
  
  <p>Any ideas? (if this is not the right site, please redirect..sorry and thanks!)</p>