- @echo off
- setlocal enabledelayedexpansion
- color 1f
- dir /b *.txt "D:\A\" >>tem.ini 2>nul
- echo 请输入你要拷贝的数量,按回车继续
- set /p s=
- echo 请输入你源文件盘的文件数量,按回车继续
- set /p r=
- for /l %%a in (1,1,!s!) do (set /a n=!random! %% !r!
- for /f "delims=: tokens=1*" %%i in ('findstr /n ".*" tem.ini') do (
- if !n!==%%i (copy /y D:\A\%%j D:\B\)
- )
- )
- cls
- del tem.ini
- pause
复制代码 目录要根据你的实际修改一下 |