Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for shuffle.bat

(view source code of shuffle.bat as plain text)

  1. @ECHO OFF
  2. SETLOCAL ENABLEDELAYEDEXPANSION
  3. SET TmpFile=tmp%RANDOM%%RANDOM%.tmp
  4. TYPE NUL >%Tmpfile%
  5. FOR /F "tokens=*" %%i IN ('MORE') DO SET Key=!RANDOM!!RANDOM!!RANDOM!000000000000& ECHO !Key:~0,15!%%i>> %TmpFile%
  6. FOR /F "tokens=*" %%i IN ('TYPE %TmpFile% ^| SORT') DO SET Line=%%i&ECHO.!Line:~15!
  7. ::DEL %TmpFile%
  8. ENDLOCAL
  9.  

page last uploaded: 2017-07-06, 12:37