*--You can all together at once, but as Borislav showed, put it in a try catch... lcDirectory = '\mydir\mydir2\mydir3' IF !DIRECTORY(sys(5)+lcDirectory) TRY mkdir Sys(5)+lcdirectory CATCH *--Process the error ENDTRY ENDIF ? DIRECTORY(sys(5)+lcDirectory) *--Or one by one... lcDirectory = '\mydir' IF !DIRECTORY(sys(5)+lcDirectory) mkdir Sys(5)+lcdirectory ENDIF lcDirectory = '\mydir\mydir2' IF !DIRECTORY(sys(5)+lcDirectory) mkdir Sys(5)+lcdirectory ENDIF * replace sys(5) with the drive letter and colon e.g. c: or d: or e: etc.>The COPY FILE command does not seem to work if the destination folder deos not exist. For example if I use the command