Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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
Batch file 需要复制和重命名不同文件夹中的文件_Batch File_Copy_File Rename - Fatal编程技术网

Batch file 需要复制和重命名不同文件夹中的文件

Batch file 需要复制和重命名不同文件夹中的文件,batch-file,copy,file-rename,Batch File,Copy,File Rename,是否有人知道如何编写一个(或两个)批处理文件,以: 复制位于不同文件夹中的数百个“index.html”文件并保存在同一文件夹中(因此需要在子文件夹中搜索) 将副本重命名(保持原样)为“index.jpg” 有人能帮忙吗?我使用批量重命名工具将主文件夹副本中的所有index.html文件重命名为index.jpg,然后使用robocopy将所有内容复制过来,包括文件结构复制回原始文件夹(不使用index.html)请给出一个目录结构的示例好吗?是这样的:(Directory1->index.ht

是否有人知道如何编写一个(或两个)批处理文件,以: 复制位于不同文件夹中的数百个“index.html”文件并保存在同一文件夹中(因此需要在子文件夹中搜索) 将副本重命名(保持原样)为“index.jpg”


有人能帮忙吗?

我使用批量重命名工具将主文件夹副本中的所有index.html文件重命名为index.jpg,然后使用robocopy将所有内容复制过来,包括文件结构复制回原始文件夹(不使用index.html)

请给出一个目录结构的示例好吗?是这样的:(Directory1->index.html,Directory2)|(Directory2->index.html)如果是这样的话,最终的结果应该是什么?upload_files\P1030582.jpg\width\500\index.html-upload_files是主目录,但之后是名称不同的文件夹,没有结构。我想把新的副本和原件放在同一个文件夹里,例如,您可能会有以下内容:upload\u files\DirectoryA\index.html和upload\u files\DirectoryB\index.html,作为最终结果,您希望将这两个index.html文件复制为upload\u files\index-HTMLS\index1.html和upload\u files\index-HTMLS\index2.html?从upload\abcd123\index.html开始upload_files\987fgh\index.html-在我想要之后:upload_files\abcd123\index.html,然后在同一文件夹index.jpg内,upload_files\987fgh\index.html和同一文件夹index.jpg内-基本上,我希望所有index.html文件都保存在其当前文件夹中,并将重命名为index.jpg的副本与复制它们的文件放在同一文件夹中