 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Sailoratbay
Joined: 16 Mar 2010 Posts: 2
|
Posted: Tue Mar 16, 2010 1:10 pm Post subject: FileMove & FileCopy Problem |
|
|
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] |
|
| Back to top |
|
 |
fincs
Joined: 05 May 2007 Posts: 1160 Location: Seville, Spain
|
|
| Back to top |
|
 |
Sailoratbay
Joined: 16 Mar 2010 Posts: 2
|
Posted: Tue Mar 16, 2010 6:12 pm Post subject: Problem Solved |
|
|
Fine advice fincs , it just works now !
Thanks a lot for your help ! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|