{Edit} Somewhere along the line *.dgn has transformed into *.dat {/Edit}
This is UNTESTED, but gives you the logic, I think...
code:
WHILE 1=1 "Project Folder Number:" ? 
GETS $projfile
$dirplus = DirPlus($workingdir\$projfile,*.*",1)
$oldfolder=""
FOR EACH $item IN $dirplus
$offset=INSTRREV($item,"\") ; find the last backslash in $item
$newfolder=SUBSTR($item,1,$offset-1) ; save the 'new' folder name only
IF INSTR($item,".DAT") AND $newfolder<>$oldfolder ; folder names don't match
SHELL $cmdstr ; do the copy
ENDIF
$oldfolder=$newfolder ; save the 'new' as the 'old' folder name
NEXT
LOOP



[ 09. October 2002, 23:11: Message edited by: Waltz ]
_________________________
We all live in a Yellow Subroutine...