System : XPSP2
AHK 1.0.48.05
Problem : Bug in FileMove & FileCopy
I'm trying to rename a set of file in a directory because their names has a special char not supported by another prog of mines :
L'histoire secrКte - 01 - 00.jpg
L'histoire secrКte - 01 - 01.jpg
L'histoire secrКte - 01 - 02.jpg
... up to 53 suche files
the "К" (not a "K") in the middle of the name induces a strange behaviour to FileMove & FileCopy :
I use the very simple AHK script :
Code:
SetWorkingDir %1% ; drag&drop folder on script
Loop, *.* {
Filename=%A_LoopFileName%
Shortname:=SubStr(Filename,RegExMatch(Filename,"[0-9].*")) ; string extraction starts with first numerical char
IfExist, %Filename%
MsgBox, Shortname=%Shortname% ; last allright point
; FileCopy, %Filename%, %Shortname%
FileMove, %Filename%, %Shortname% ; does nothing
ErrCount:=ErrLevel
if (ErrCount>0) ; AND no error reported
Break
}
MsgBox, ErrCount=%ErrCount%
This should show "Shortname=01 - 00.jpg" in a mesage box and rename the file "L'histoire secrКte - 01 - 00.jpg" to "01 - 00.jpg" and so on.
What I see is :
-mesage box is shown right, so the file name (with "К") is correctly seen by IfExist and the string extraction is OK, but
** FileMove (or FileCopy) does nothing **
** No ErrLevel is reported **
if I change manually the offending char in files to an "e", it works just fine but this is precisely what I try to avoid (manual work I mean).
So, any clue ?
[Moved from Bug Reports forum. ~jaco0646]