Four months ago, we discussed the method of randomly obtaining file names together and found that the best code is:
A question about randomly obtaining file names
The code from moderator Wunaihe on floor 24:
And the codes modified by everyone later
Tonight, inspired by the "set ." special usage (sorting) from redtek on floor 15 in:
A question about randomly obtaining file names
The code from moderator Wunaihe on floor 24:
@echo off
if "%1" NEQ "$" (
for /f "tokens=1,2 delims=:" %%a in ('"%~0" $^|sort') do @echo %%b
) else for /f "delims=" %%i in ('dir /b /a-d *.mp3') do @call :sub %%i
goto :EOF
:sub
echo %random%:%*
goto :EOF
And the codes modified by everyone later
Tonight, inspired by the "set ." special usage (sorting) from redtek on floor 15 in:
@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%i in ('dir/a-d/b *.mp3') do set $!random!!random!$%%i=$
for /f "tokens=1,2* delims=$=" %%i in ('set $') do echo %%j
pause
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| ccwan | +5 | 2006-12-09 21:43 |


):