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
- //IP Address/C$/ShareFolder
- net use Z: /persistent:yes //IP Address/C$/ShareFolder
I first tried to make the Z drive my todir.
<copy todir="Z:/Results/">
<fileset dir="${LocalResults}">
<include name="**/*"/>
</fileset>
</copy>
Here is the output from Jenkins
[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)
If I use the location instead of the mapped drive, it will work.
<copy todir="//IP Address/C$/ShareFolder/Results/">
<fileset dir="${LocalResults}">
<include name="**/*"/>
</fileset>
</copy>
Is there a reason that using the mapped drive in the todir will not work?