Here is a routine I use on Windows to copy all files in a directory.
You can tweak it to change the filenames.
40400 COPY_DIR:! ^0200
40410 local fr_file$,to_file$,file_list$,command$
40420 ! needs fully pathed source$ and dest$
40430 source$=sub(source$,"/","\")
40440 call "*dirtree",source$,file_list$,sep,0
40450 while not(nul(file_list$))
40460 fr_file$=file_list$(1,pos(sep=file_list$)-1),file_list$=file_list$(pos(sep=file_list$)+1)
40470 to_file$=sub(fr_file$,source$,dest$)
40472 module$=fr_file$(pos("\"=fr_file$,-2)+1,2)
40474 if pos(module$=module_skip_list$,2) then continue
40480 ! Create any sub directories needed
40490 for i=1 to pos("\"=to_file$,1,0)
40500 directory to_file$(1,pos("\"=to_file$,1,i)),err=*next
40510 next i
40520 erase to_file$,err=*next
40530 command$=env("comspec")+" /c copy "+fr_file$+" "+to_file$
40540 invoke wait hide command$
40550 wend
40560 return