我有10个文件夹,每个文件夹包含一个excel文件。如何使用bat文件使用命令功能复制所有10个文件?
此循环遍历您的“parent_folder_path”,包括 Excel 文件的子文件夹,并将每个文件夹复制到您的“destination_folder_path”
for /f "tokens=*" %a in ('where /R "parent_folder_path" *.xlsx') do copy "%%a" "destination_folter_path"
:: 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