On Windows, cp a.txt b.txt fails at line 252 with message "cp: can not access B.TXT ... skipping".

Overall, this script has problems with case sensitivity, for example cp a.txt dir will create dir/A.TXT.