title: Use ANT to copy files from local directory to a mapped drive
body: <p>I want to move files from my local machine to a mapped drive using ANT. I mapped my Z drive to the below location using  using the net use command</p>
  
  <ul>
  <li>//IP Address/C$/ShareFolder</li>
  <li>net use Z: /persistent:yes //IP Address/C$/ShareFolder</li>
  </ul>
  
  <p>I first tried to make the Z drive my todir. </p>
  
  <pre><code>&lt;copy todir="Z:/Results/"&gt;
    &lt;fileset dir="${LocalResults}"&gt;
      &lt;include name="**/*"/&gt;
    &lt;/fileset&gt;
  &lt;/copy&gt;
  </code></pre>
  
  <p>Here is the output from Jenkins</p>
  
  <pre><code>[copy] Copying 16 files to Z:\Results
  Attempt to copy C:\Program Files\results\index.html to Z:\Results\index.html using NIO Channels failed due to 'failed to create the parent directory for Z:\Results\index.html'.  Falling back to streams.
  
  BUILD FAILED
  C:\Deploy\copyResults.xml:69: Failed to copy C:\Program Files\results\index.html to Z:\Results\index.html due to java.io.FileNotFoundException Z:\Results\index.html(The system cannot find the path specified)
  </code></pre>
  
  <p>If I use the location instead of the mapped drive, it will work.</p>
  
  <pre><code>&lt;copy todir="//IP Address/C$/ShareFolder/Results/"&gt;
    &lt;fileset dir="${LocalResults}"&gt;
      &lt;include name="**/*"/&gt;
    &lt;/fileset&gt;
  &lt;/copy&gt;
  </code></pre>
  
  <p>Is there a reason that using the mapped drive in the todir will not work?</p>