从文件夹中提取excel文件

问题描述 投票:0回答:2

我有10个文件夹,每个文件夹包含一个excel文件。如何使用bat文件使用命令功能复制所有10个文件?

batch-file cmd command batch-processing
2个回答
0
投票

此循环遍历您的“parent_folder_path”,包括 Excel 文件的子文件夹,并将每个文件夹复制到您的“destination_folder_path”

for /f "tokens=*" %a in ('where /R "parent_folder_path" *.xlsx') do copy "%%a" "destination_folter_path"


0
投票
:: Set the source folders and the destination folder
set destination="C:\path\to\destination\folder"

:: Folder paths
set folder1="C:\path\to\folder1"
set folder2="C:\path\to\folder2", etc

:: Copy Excel files from each folder to the destination folder
copy %folder1%\*.xls* %destination%
copy %folder2%\*.xls* %destination%, etc
© www.soinside.com 2019 - 2024. All rights reserved.