来个超低效率的
请确认确实是1楼所说的
D:\TXT文件夹 里面有多个txt文件夹
不过 不是文件夹 而是 文件也行- @echo off&pause
-
- set "f=D:\TXT文件夹"
- set "fd=E\123文件夹"
-
- for /r "%f%" %%a in ("*.txt") do set /a n+=1
-
- for /d %%a in ("%fd%\*") do (
- set folder=%%a
- call :aaa
- )
-
- echo,&pause&exit /b
-
- :aaa
- set /a r=%random% %% %n%+1
- set m=0
- for /r "%f%" %%b in ("*.txt") do (
- set file=%%b
- set /a m+=1
- setlocal enabledelayedexpansion
- if !m! == !r! (
- rem echo,!r!
- echo,&echo copy "!file!" to "!folder!"
- copy /y "!file!" "!folder!"
- endlocal
- goto :eof
- )
- endlocal
- )
复制代码
|