title: How to copy directory symbolic link as a link to the target?
body: <p>Say, I created a directory symbolic link using the <a href="http://technet.microsoft.com/en-us/library/cc753194.aspx" rel="nofollow">mklink</a> command as such:</p>
  
  <p>mklink /d "test dir link1" "dest dir"</p>
  
  <p>How can I copy it as a link to the target directory? When I try to use the CopyFileEx API and the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363852%28v=vs.85%29.aspx" rel="nofollow">COPY_FILE_COPY_SYMLINK</a> flag as such:</p>
  
  <pre><code>::CopyFileEx(L"D:\\Path to source\\test dir link1",
      L"D:\\Path to destination\\test dir link1 copy",
      NULL, NULL, NULL, 
      COPY_FILE_COPY_SYMLINK);
  </code></pre>
  
  <p>it returns error code <code>ERROR_ACCESS_DENIED</code>.</p>
  
  <p>PS. I tried running my process elevated (just in unlikely scenario that I need to run elevated) and it still gave me the same error code.</p>