Thermoptic Posted October 5, 2006 Posted October 5, 2006 Hi! First post here, Great show, great forum! I just got a remote control for my pc (ATI Remote Wonder 2) And im going to use this to control winamp, video etc. There are 6 buttons that you can customize on this remote, i have placed a winamp playlist file to start when i press on one of these buttons. But i want to have more that just 6 playlists. So i got this idea. I'm looking for a program that can start a file randomly from a specific folder. This way i can just attach this randomizer program to one of the buttons on the remote. And just press it some this to get different playlists from this folder. It could just be a exe called random.exe that i put in the same dir as the .pls files and when i run this it starts one of the files in this dir. Or is it possible to do this via a bat script? Thanks! Quote
pseudobreed Posted October 5, 2006 Posted October 5, 2006 Copy and paste the code into a .vbs file in the directory of your playlist. Dim oFolder Dim oFile Dim iCount Dim Random ReDim szaFiles(0) Set wshShell = CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") Set oFolder = FSO.GetFolder(".") For Each oFile In oFolder.Files iCount = UBound(szaFiles) + 1 ReDim Preserve szaFiles(iCount) szaFiles(iCount) = oFile.Path Next Randomize Random = Int((iCount) * Rnd + 1) wshShell.Run chr(34) & szaFiles(Random) & chr(34) Then just have your remote call the .vbs file. Quote
Thermoptic Posted October 5, 2006 Author Posted October 5, 2006 Thanks pseudobreed! The Code works great. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.