Latest WACUP public preview for x86 & x64 is build #23528 (January 12th 2026) (x86 & x64 changelogs)
Latest restricted WACUP beta release is build #23528 (January 12th 2026) (x86 & x64 changelogs)

Author Topic: AUTOMATION AND RANDOMITY MS-DOS BATCH CODE FOR WACUP/WINAMP  (Read 12083 times)

Dsalomon

  • Full Member
  • ***
  • Posts: 24
  • buscado herramientas por el ancho internet
    • View Profile
AUTOMATION AND RANDOMITY MS-DOS BATCH CODE FOR WACUP/WINAMP
« on: April 23, 2019, 09:09:56 AM »
Good morning, today I bring you a trick, that a friend designed me, although, the original idea is mine and I wrote it once, but when corrected this is the result.
Imagine that in a folder they have a huge collection of music videos, cartoons (without continuity) or just a large number of various files.

These files want to place them randomly to the winamp list for playback and to play them.

For this you have to create an MS-DOS batch batch file
In a new block of notes paste the following code:


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@Echo OFF & chcp 1252 >NUL & Setlocal enabledelayedexpansion
REM Title %~n0 & Mode con cols=50 lines=3
 
Set /A "MAX=30"
Set "TMP_Playlist=%Temp%\Playlist.tmp"
Set "Playlist=%Temp%\Playlist.m3u"
 
:List
(
 For /F "Tokens=*" %%$ in (
     'Dir /B /S "%~dp0" ^| Findstr /I /R "\.avi$ \.mkv$ \.mp4"'
 ) DO (
     Echo !Random!!Random!!Random!;%%$
 )
)>"%TMP_Playlist%"
 
:Randomize
(
 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)
ping localhost -n 8 >nul
Exit /B 0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Finally, save it in the same folder where you have the videos with extension .bat

When the file is executed, it will be added to the list and the files indicated will be reproduced randomly
In this case to say the amount of videos modify this line to your need

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Set /A "MAX=30"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


And the extensions in this line:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'Dir /B /S "%~dp0" ^| Findstr /I /R "\.avi$ \.mkv$ \.mp4"'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I hope it serves you, I use it every day, for my community TV channel.