View Single Post
Old 7th October 2013, 20:44   #2
Dsalomon
Junior Member
 
Join Date: May 2011
Posts: 3
Ramdom VIDEO AVI & MKV EN CARPETA





code:
@Echo OFF & chcp 1252 >NUL & Setlocal enabledelayedexpansion
REM Title %~n0 & Mode con cols=50 lines=3
Set /A "MAX=5"
Set "TMP_Playlist=%Temp%\Playlist.tmp"
Set "Playlist=%Temp%\Playlist.m3u8"
:List
(
For /F "Tokens=*" %%$ in (
'Dir /B /S "%~dp0" ^| Findstr /I /R ".avi .mkv"'
) DO (
Echo !Random!!Random!!Random!;%%$
)
)>"%TMP_Playlist%"

:Randomize
(
Echo #EXTm3u8
For /F "Tokens=2* Delims=;" %%$ in (
'Type "%TMP_Playlist%" ^| Sort '
) DO (
Set /A "Count+=1"
If !COUNT! LSS %MAX% (
Echo %%$
) ELSE (
Goto :Run
)
)
)>"%Playlist%"
:Run
Start /B "" "%PROGRAMFILES(X86)%\Winamp\winamp.exe" "%Playlist%" || (Exit /B 1)
Exit /B 0

Dsalomon is offline   Reply With Quote