in C:/1 there are two directories (see file attached), every directory have 2 photos
The download command you are using will download every folder in the DCIM folder. It seems that two of your cameras have different folder names.
To avoid collisions (where the file number and folder happens to be the same on more than one camera), you should probably download a unique directory for each camera. Something like
function download_and_delete()
for i,lcon in ipairs(mc.cams) do
con=lcon
cli:print_status(cli:execute('mdl A/DCIM C:/'..i..'/ -fmatch=%.JPG$'))
cli:print_status(cli:execute('rm A/DCIM '))
end
end
should do it download each one into a numbered folder for the camera. Note the numbers are just the order the cameras happened to be listed, so will not necessarily stay the same for each session. If you want to uniquely identify them, you could use the serial numbers.
If you don't want to get the camera folder names (100___05 etc) you will have to do a little more coding. I have plans to make this simpler in chdkptp, but I have a lot more plans than time ...
The code I've posted here is meant as a simple example to get you started, not a complete solution.