- @echo off
- setlocal enabledelayedexpansion
- set fileNum=5
- set fileID=0
- set folderPre=MyFolder
- set folderSuf=0
- for /f "delims=" %%a in ('dir /b /a-d') do (
- set /a mod=!fileID! %% %fileNum%
- if "!mod!" == "0" (
- set /a folderSuf+=1
- md "%folderPre%_!folderSuf!"
- )
- set /a fileID+=1
- copy "%%a" "%folderPre%_!folderSuf!\"
- )
复制代码
|