cm_GotoRandom

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

cm_GotoRandom

Post by *byblo »

cm_GotoRandom: Go to a random file into the current list (also for Long view mode (CTRL+F2) and Thumbnails view)
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: cm_GotoRandom

Post 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
Overquoting is evil! 👎
Post Reply