|
|
发表于 2023-12-10 00:15:35
|
显示全部楼层
- @echo off&chcp 936
- set count=3
- set fd=___aaa
- if not exist "%fd%" md "%fd%"
- set /a fn+=1
- for /d %%x in (*) do (
- if "%%x" neq "%fd%" (
- setlocal
- for %%y in ("%%x\*.*p*") do (
- set /a a+=1&set file=%%y
- call set "@@%%random%%@%%a%%_%%~xy=%%y"
- )
- for /f "tokens=1 delims==" %%z in ('set @@ 2^>nul') do (
- set /a c+=1
- if not defined done (
- set fx=%%z
- setlocal enabledelayedexpansion
- if %count% geq !c! (
- echo copy /y "!%%z!" "!fd!\!fn!!fx:*_=!"
- copy /y "!%%z!" "!fd!\!fn!!fx:*_=!" && set /a fn+=1
- for %%h in (!fn!) do endlocal&set fn=%%h
- ) else endlocal&set done=1
- )
- )
- for /f %%h in ('echo %%fn%%') do endlocal&set fn=%%h
- )
- )
- echo,&pause&exit/b
复制代码 |
|