本帖最后由 qixiaobin0715 于 2022-9-15 16:22 编辑
- @echo off
- setlocal enabledelayedexpansion
- for /f %%i in ('dir /b /a-d ^| find /c /v ".bat"') do set n=%%i
- set /a x=0,y=0
- for /l %%i in (1,1,20) do (
- set /a m=!random!%%n
- if !x! lss 7 (
- if not defined _!m! (
- set _!m!=true
- set /a x+=1
- )
- )
- )
- for /f "delims=" %%i in ('dir /b /a-d^|find /v ".bat"') do (
- set /a y+=1
- if defined _!y! copy "%%i" "指定路径"
- )
- pause
复制代码 这样应当也行,未测试 |