2015-04-02 174 views
0

我想使用ANT将文件从本地机器移动到映射驱动器。我使用net use命令使用ANT将文件从本地目录复制到映射驱动器

  • // IP地址/ C $/ShareFolder
  • NET USE Z ^使用映射我的Z驱动到以下位置:/持久:是// IP地址/ C $/ShareFolder

我第一次试图让Z驱动器是我的todir。

<copy todir="Z:/Results/"> 
    <fileset dir="${LocalResults}"> 
    <include name="**/*"/> 
    </fileset> 
</copy> 

下面是从詹金斯

[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) 

输出。如果我使用的位置,而不是映射的驱动器,它会工作。

<copy todir="//IP Address/C$/ShareFolder/Results/"> 
    <fileset dir="${LocalResults}"> 
    <include name="**/*"/> 
    </fileset> 
</copy> 

是否有理由在todir中使用映射的驱动器不起作用?

+0

\\ MY_IP \共享\驱动器(http://stackoverflow.com/questions/23993445/accessing-linux-mount-位置上的窗户,通詹金斯/ 23998101#2399810) – Laba42 2015-04-03 08:52:15

回答

0

快速问题开始,詹金斯是运行在Windows服务器上的服务?

在这种情况下,我认为你无法使用映射驱动器(由于服务帐户)。

这是更好地与文件夹URL的工作:[吗?你已经在这里阅读]

相关问题