code:
  
$SOURCE = c:\temp
$DEST = c:\test
$FULLFILENAME = test.doc
$NAME = test
$EXTENSION = doc
$FULLSOURCE = "$SOURCE\$FULLFILENAME"
$RENAMED = "$SOURCE\$NAME-WD.$EXTENSION"
$FULLDEST = "$DEST\$FULLFILENAME"
$COUNTER = 0
? "$FULLDEST"
? " "

:CHECK
WHILE "IF EXIST ($FULLDEST)=1"
? "$FULLDEST Exists"
$FULLDEST = "$DEST\$NAME$COUNTER.$EXTENSION"
$COUNTER = $COUNTER + 1
$NEWNAME = "$NAME$COUNTER.$EXTENSION"
SHELL "%COMSPEC% /c rename $FULLSOURCE $NEWNAME"
$FULLSOURCE = "$SOURCE\$NEWNAME"
? "$FULLDEST"
? " "
LOOP

basically i want to check if a file is not in the location before i use a copy command, and if it is rename the file so it can copy with out overrighting the file i'm using the GUI copy UDF

all i need to do is check if the file exists
if it does rename the orginal file to $name$counter.$extension and then check if the file exists again and carry on this renameing untill the file does not exist

all it does at the moment is loop around what am i doing wrong?