- @echo off
- cd /d "%~dp0"
- set /p "NUM1=设置随机选取多少个文件夹>"
- set /p "NUM2=设置随机选取多少个视频>"
- set /p "NUM3=设置循环选取多少次>"
- set "batname=%~n0"
- md "%batname%" 2>nul
- powershell -c "for($i=1;$i -le $env:NUM3;$i++){$root=[io.directory]::CreateDirectory($env:batname+'\'+$env:batname+$i);get-random -InputObject (gci|?{$_.psiscontainer -and $_.Name -ne $env:batname}) -Count $env:NUM1|foreach{get-random -InputObject ($_|gci|?{-not $_.psiscontainer}) -Count $env:NUM2}|copy-item -dest $root.FullName -Force }"
- pause
复制代码 批处理保存ANSI编码 |