Page 1 of 1

cm_GotoRandom

Posted: 2022-06-10, 02:05 UTC
by byblo
cm_GotoRandom: Go to a random file into the current list (also for Long view mode (CTRL+F2) and Thumbnails view)

Re: cm_GotoRandom

Posted: 2022-06-10, 07:24 UTC
by Fla$her

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