隨便找個地方新建一個文本文檔,粘貼以下內(nèi)容:
@echo off
setlocal enabledelayedexpansion
set "source_folder=源文件夾"set "destination_folder=目標文件夾"
set "max_files_per_folder=2000"
set "folder_count=0"
set "file_count=0"
for %%F in ("%source_folder%\*.*") do (
set /a "file_count+=1"
set "target_folder=!destination_folder!\Folder_!folder_count!"
if not exist "!target_folder!" (
mkdir "!target_folder!"
)
move "%%F" "!target_folder!"
if !file_count! geq %max_files_per_folder% (
set /a "file_count=0"
set /a "folder_count+=1"
)
)
echo All files have been moved into subfolders.
pause
將其保存成bat,批處理文件,就可以啦!