Opt('MustDeclareVars', 1) ;... Global $sDir = 'd:\Miscel\Pics\Old comp\';... ;... Global $sDir = @ScriptDir & '\0', $aFiles, $sString = '|', $iRand $aFiles = _FileSearch($sDir, '*', 1) If @error Then Exit ConsoleWrite('Files: ' & $aFiles[0] & @LF) For $i = 1 To $aFiles[0] $iRand = Random(1, $aFiles[0], 1) While 1 $iRand = Random(1, $aFiles[0], 1) If Not StringInStr($sString, '|' & $iRand & '|') Then $sString &= $iRand & '|' ExitLoop