简体   繁体   English

Windows蝙蝠文件复制问题

[英]windows bat file copy issue

The below lines need to copy all the folders from \\Reports\\Input to \\Deliver\\Unidentified\\Requests. 下面几行需要将所有文件夹从\\ Reports \\ Input复制到\\ Deliver \\ Unidentified \\ Requests。 Input directory contains lot of folders which contains files. 输入目录包含许多包含文件的文件夹。

but Below code is not copying. 但以下代码未复制。

If I change dir /b /ad *`) then it is copying only the files from the input folder subdirectories files. 如果我更改dir / b / ad *`),则它仅复制输入文件夹子目录文件中的文件。

How to change this Please help on this. 如何更改此内容请对此提供帮助。 Thanks advance 谢谢前进

Struture: 结构:

under Report --> Deliver,Input folder is there 在报告->发送下,输入文件夹在那里

under Input folder -- Response 1,2,3... folder which contains files. 在输入文件夹-包含文件的响应1,2,3 ...文件夹下。

CD %AUTOMATEDTESTHTTPDIR%\..\Reports\Input
FOR /F "usebackq tokens=*" %%i IN (`dir /ad *`)  DO (
                ECHO %%i
                CD "%%i"
                COPY * ..\..\Deliver\Unidentified\Requests
                cd..
)
xcopy /S %AUTOMATEDTESTHTTPDIR%\..\Reports\Input\* %AUTOMATEDTESTHTTPDIR%\..\Deliver\Unidentified\Request\

should work. 应该管用。 The /S parameter is for recursively copying the files. /S参数用于递归复制文件。
You might not need to use a for-loop at all. 您可能根本不需要使用for循环。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM