>I wrote this piece of code because I had hundreds of files with different formatting - document names would contain the same words in different order etc, making it hard to spot the duplicates or near duplicates, so
>
>
LPARAMETERS tcGde, tcMenjaj, tcSa
>
>LOCAL lcFrom, lcTo, lnKomada
>LOCAL aa[1], i
>
>lnKomada=ADIR(aa, FORCEPATH("*.*", tcGde),"",1)
>FOR i=1 TO lnKomada
> lcStem=aa[i,1]
> IF ATC(tcMenjaj, lcstem)>0
> lcTo=STRTRAN(lcstem, tcMenjaj, tcSa, 1, 1, 1)
> lcFrom=FORCEPATH(lcStem, tcGde)
> lcTo=FORCEPATH(lcTo, tcGde)
> RENAME (lcFrom) TO (lcTo)
> ENDIF
>ENDFOR
>
>And it works as I intended, except that the rename command ignores the case of its parameters and I end with a filename with all lowercase. A tad better than all uppercase, but that's not what I wanted. Specially as many filenames contain names, which should be in proper case. Checked in the debugger, the lcTo contains the filename as it should be.
>
>Any ideas why, or how to fix this? I guess using scripting.filesystem would do the trick, but I'm just curious to know what's going on and whether this can be prevented.
https://www.berezniker.com/content/pages/visual-foxpro/copy-move-rename-file-preserving-destination-name-case