Because you want to initiate the copy only if the foldername changes. However, this would assume that the folders are sorted since you might have multiple .DAT files in any given folder.
So, you should do the following:
1) Retrieve all folders containing a .DAT file into an array
2) Sort the array (e.g. BubbleSort, QSort)
3) Copy folder to new destination if foldername not equal previous foldername

[ 09. October 2002, 21:25: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.