cm_GotoRandom
Moderators: white, Hacker, petermad, Stefan2
cm_GotoRandom
cm_GotoRandom: Go to a random file into the current list (also for Long view mode (CTRL+F2) and Thumbnails view)
Re: cm_GotoRandom
Code: Select all
'•••••••••••••••••••••••••••••••••• VBS •••••••••••••••••••••••••••••••••
' Purpose: move the cursor to a random directory file of the active panel
' Condition: the start path of the button or custom command must be blank
'••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
With CreateObject("WScript.Shell")
Set Items = CreateObject("Shell.Application").NameSpace(.CurrentDirectory).Items
Items.Filter 73920, "*" : Cnt = Items.Count : If Cnt Then Randomize :_
.Exec "%COMMANDER_EXE% /A /S """ & Items.Item(CLng(Round(Rnd * (Cnt-1)))).Path & """"
End With
Overquoting is evil! 👎