Latest restricted WACUP beta release is build #18654 (March 24th 2024) (x86 & x64 changelogs) | Latest WACUP public preview is build #17040 (September 30th 2023) (x86 only)


NOTE: Beta testers are added in a limited & subjective manner as I can only support so many people as part of the beta test program to keep it useful for my needs.

Unless I think you're going to be helpful, not all requests will be accepted but might still be later on. Remember that beta testing is to help me & the limitations currently works for my needs for this project.

Author Topic: AUTOMATION AND RANDOMITY MS-DOS BATCH CODE FOR WACUP/WINAMP  (Read 3613 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.