Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 使用Xcopy将文件从源复制到目标_File_Batch File_Copy_Using_Xcopy - Fatal编程技术网

File 使用Xcopy将文件从源复制到目标

File 使用Xcopy将文件从源复制到目标,file,batch-file,copy,using,xcopy,File,Batch File,Copy,Using,Xcopy,我使用xcopy仅将修改过的文件从源复制到目标。我的代码在下面 xcopy C:\Source\*.csv C:\Target /D /S /Y xcopy C:\Source\*.txt C:\Target /D /S /Y 它很好用。 但一旦它复制了文件,我们的运行接口就会生成.ok文件。然后再次复制文件。这是一个连续的过程。示例:-test.txt获取从源到目标的副本 Source:- test.txt Target:-test.txt 正在运行接口将

我使用xcopy仅将修改过的文件从源复制到目标。我的代码在下面

    xcopy C:\Source\*.csv C:\Target /D /S /Y 
    xcopy C:\Source\*.txt C:\Target /D /S /Y
它很好用。 但一旦它复制了文件,我们的运行接口就会生成.ok文件。然后再次复制文件。这是一个连续的过程。示例:-test.txt获取从源到目标的副本

    Source:- test.txt
    Target:-test.txt
正在运行接口将测试转换为.ok文件

 Target:-test_07-Mar-2016_03-16-50.089.ok
再次复制文件并生成接口.ok文件,现在在目标中

 Target :- test.txt
           test_07-Mar-2016_03-16-50.089.ok
这种事一次又一次地发生

Target :- test.txt
          test_07-Mar-2016_03-16-50.089.ok
          test07-Mar-2016_03-06-50.515._oK
有人能帮我做这个吗。

也许吧

    xcopy /exclude:test.txt C:\Source\*.txt C:\Target /D /S /Y

你为什么在你的帖子上贴上标签?点击标签并阅读其含义。无论如何,我不理解这个问题,但是您可能对
xcopy
/U
开关感兴趣,以便只复制目标中已经存在的文件(在命令提示窗口中键入
xcopy/?
,然后阅读帮助文本)?我认为它不起作用。。它似乎是硬编码的。有多个文件,因此需要不同的解决方案。