I rewrote one, without text queries, using clearing the variables already written into the list to judge the loop-generated random numbers.
137 files completed within 30 seconds (if the random numbers are lucky then it will be faster; later on there are fewer valid variables so it gets slower):
don't include the red parts
Seems there is a small problem: sometimes it exits with failure:(
[ Last edited by zxcv on 2006-7-28 at 01:19 ]
137 files completed within 30 seconds (if the random numbers are lucky then it will be faster; later on there are fewer valid variables so it gets slower):
don't include the red parts
pause
cls
@echo off
copy nul List.txt >NUL
setlocal EnableDelayedExpansion
for /f "delims=" %%a in ('dir/b *.mp3^|find ".mp3"') do (
set /a N=!N! + 1
set Name!N!=%%a)
echo.
echo Randomly generating the list, please wait...
echo.
echo Serial number - random filename
echo.
:loop
set N=%random:~-3%
if "%N%" == "000" goto loop
if "%N:~0,1%" == "0" set N=%N:~1%
if "%N:~0,1%" == "0" set N=%N:~1%
if %N% GTR 137 goto loop“137” file count
echo set Name=%%Name!N!%%>Temp.batcheck whether this variable has been cleared
call Temp.bat
if "%Name%" == "" goto loop
set /a M=%M%+1
echo echo %%M%% - %%Name!N!%%>Temp.batdisplay serial number - random filename
echo echo %%Name!N!%%^>^>List.txt>>Temp.bat
call Temp.bat
set Name!N!=clear the variable already written into the list
if %M% GEQ 137 goto End“137” file count
goto loop
:End
del Temp.bat
echo.
echo Done!
echo.
pause
exit
Seems there is a small problem: sometimes it exits with failure:(
[ Last edited by zxcv on 2006-7-28 at 01:19 ]

DigestI
