And yes this will work with Glenn Miller too
Filched from UBI Forums, posted by JRJacobs:
Random InFlight Music
Here's a little VB script that will randomize your music - I did not create it, sombody named PXL did. I only modified it for IL2.
1st rename all your inflight music.
append/paste any three numbers in FRONT of the wav file. (i used "123-")
Paste the following into a text file
___________________________________________________________________
const FilesSubdir="samples\Music\InFlight"
Napis = "InFlight Randomizer for IL2 "& dirtobecleaned &"?"
Titulek = "Windows Scripting Host"
Dim intDoIt
Dim fso, fold, ffil, ffilact, num
Randomize
Call Welcome()
Set fso = CreateObject("Scripting.FileSystemObject")
Set fold = fso.GetFolder(Fso.getAbsolutePathName("")& "\" & Filessubdir)
Set ffil = fold.Files
For Each ffilact in ffil
num=int(rnd*999)
ffilact.move(fold.path & "\" & string(3-len(cstr(num)),"0") & cstr(num) & right(ffilact.name,len(ffilact.name)-3))
Next
msgbox "Run IL2 and Enjoy"
Sub Welcome()
intDoIt = MsgBox(Napis, vbOKCancel + vbinformation, Titulek )
If intDoIt = vbCancel Then WScript.Quit
End Sub
_____________________________________________________
Close and save the text file
Place it into your "IL-2 Sturmovik Forgotten Battles" folder and rename it IL2RandomMusic.vbs (the name's not important the vbs is)
right-click on IL2RandomMusic.vbs select copy, then right-click on your desktop and select create "shortcut".
Now BEFORE you start IL2 run the shortcut and it will RANDOMIZE the first three numbers.
If you wish you can run this from a batch file (FSAuto start enable it ) by putting:
cscript IL2RandomMusic.vbs
into a batch file.