Copy random file from random subfolder into destination folder using a windows bat script
Try this (set folder names and number of files to copy):
@echo off&setlocal enabledelayedexpansion
set "musicroot=test"
set "playfolder=output"
set /a filecount=20
pushd "%musicroot%"
for /r %%i in (*.mp3) do set /a files+=1& set "$!files!=%%~i"
popd
pushd "%playfolder%"
:randomloop
set /a rd=%random%%%files+1
set "mp3=!$%rd%!"
if not defined mp3 goto :randomloop
set "$%rd%="
for %%i in ("%mp3%") do if exist "%%~nxi" echo "%%~nxi" already exist in %playfolder%.& goto:randomloop
copy "%mp3%"
set /a filecount-=1
if %filecount% gtr 0 goto:randomloop
popd