@echo off :: FILENAME: ads.bat :: BATCH File to make 40 Ad Breaks for the 24 hour day :: CONTACT: brian@radio.ie :: SET THE NUMBER OF ADS, a number that divides into the total number of blocks :: example 5 into 40 set /a ads=5 :: Where the 5 ad breaks are in the same directory named as follows :: 1.mp3 :: 2.mp3 :: 3.mp3 :: 4.mp3 :: 5.mp3 :: SET THE NUMBER OF AD BREAKS, a number that is divisible by the total number of different ads :: example 40 set /a divs=40 / %ads% setlocal ENABLEDELAYEDEXPANSION :: SET THE TIME PART OF THE FILENAME set f[0]=7.00 AM set f[1]=8.00 AM set f[2]=9.00 AM set f[3]=9.20 AM set f[4]=9.40 AM set f[5]=10.00 AM set f[6]=10.20 AM set f[7]=10.40 AM set f[8]=11.00 AM set f[9]=11.20 AM set f[10]=11.40 AM set f[11]=12.00 PM set f[12]=12.20 PM set f[13]=12.40 PM set f[14]=1.00 PM set f[15]=1.20 PM set f[16]=1.40 PM set f[17]=2.00 PM set f[18]=2.20 PM set f[19]=2.40 PM set f[20]=3.00 PM set f[21]=4.00 PM set f[22]=4.20 PM set f[23]=4.40 PM set f[24]=5.00 PM set f[25]=5.20 PM set f[26]=5.40 PM set f[27]=6.00 PM set f[28]=7.00 PM set f[29]=8.00 PM set f[30]=9.00 PM set f[31]=10.00 PM set f[32]=11.00 PM set f[33]=12.00 AM set f[34]=1.00 AM set f[35]=2.00 AM set f[36]=3.00 AM set f[37]=4.00 AM set f[38]=5.00 AM set f[39]=6.00 AM set /a count=0 set /a countp=1 FOR /L %%A IN (1,1,%divs%) DO ( FOR /L %%B IN (1,1,%ads%) DO ( call mklink /H "[ADVERTS] %%f[!count!]%%.mp3" %%B.mp3 set /a count=count+1 set /a countp=countp+1 ) )