on error resume next Set ap = CreateObject("Shell.Application") Set fs = CreateObject("Scripting.FileSystemObject") p = fs.GetParentFolderName( WScript.ScriptFullName ) Set fol = ap.NameSpace( p ) Set it = fol.Items() dim s() i = 0 For Each f in it If f.Type = "MP3 audio file (mp3)" or f.Type = "MP3 Format Sound (.mp3)" or f.Type = "MP3 Format Sound" then i = i + 1 art = fol.GetDetailsOf( f, 13 ) alb = fol.GetDetailsOf( f, 14 ) son = fol.GetDetailsOf( f, 20 ) if len( trim( art ) ) > 0 then Redim Preserve s( i ) set s( i ) = New Song s( i ).init f.name , art , alb , son end if end if Next n = i o = "" pa = "" if n > 9999 then n = 9999 end if for i = 1 to n r = rand( n ) u = 0 Do while ( pa = s( r ).artist or s( r ).picked ) and u <= 9999 r = rand( n ) u = u + 1 loop pa = s( r ).artist s( r ).picked = True if s( r ).virgin then fs.MoveFile p & "\" & s( r ).filename , p & "\" & Right( "0000" & i , 4 ) & "_" & s( r ).filename else fs.MoveFile p & "\" & s( r ).filename , p & "\" & Right( "0000" & i , 4 ) & "_" & mid( s( r ).filename , 6 ) end if next msgbox "fini - " & n & " songs were sequenced." Class Song Public filename Public artist Public album Public song Public picked public virgin Sub init( fn , art , alb , son ) filename = fn artist = art album = alb song = son picked = false virgin = true if len( fn ) > 5 then x = left( fn , 4 ) if isnumeric( x ) and mid( fn , 5 , 1 ) = "_" then virgin = false end if end if End Sub End Class Function rand( c ) Randomize rand = ( Int( ( c ) * Rnd + 1 ) ) End Function ' -- John Weider