Command line: play newer file in a folder, shuffled
Posted: 27 Sep 2010 14:41
by Zane
Hi all,
I'm looking for command line parameters to play only those files of a folder that were created in the last 90 days. Is that possible directly or should I script it?
Thanks!
Re: Command line: play newer file in a folder, shuffled
Posted: 28 Sep 2010 10:40
by Jean-Baptiste Kempf
You should script it.
Re: Command line: play newer file in a folder, shuffled
Posted: 28 Sep 2010 13:01
by Zane
Thanks j-b.
Autohotkey did the trick.
Here it's the code, if someone will ever need to do the same:
Code: Select all
DataLimite=%A_Now%
EnvAdd, DataLimite, -90, days
Loop, D:\Music\*, 0, 1
{
if (A_LoopFileTimeCreated>DataLimite and (A_LoopFileExt="mp3" or A_LoopFileExt="wma"))
{
ElencoInMemoria=%ElencoInMemoria%`r`n%A_LoopFileLongPath%
}
}
if(ElencoInMemoria=="")
{
ElencoInMemoria=D:\Music\DefaultSong.mp3
}
FileDelete, D:\Programs\VLC media player\latest.m3u
FileAppend, %ElencoInMemoria%, D:\Programs\VLC media player\latest.m3u
Run, "D:\Programs\VLC media player\vlc.exe" --volume=256 --random "D:\Programs\VLC media player\latest.m3u"