Did you learn nothing from your previous posts Sort files and No. files in folder? The advice that davorg has given you, it would seem you already knew (at lease some of this) based on your code you posted in No. files in folder, to which other monks replied giving you help.