Sign in to follow this  
Followers 0
Gene

Having trouble with the FileMove command

5 posts in this topic

#1 ·  Posted (edited)

I'm using the 1/30/2005 version of AutoIt3 and running Win2K Pro, sp4.

MsgBox(4096, "Move data", $sSourcePath & "\" & $aFiles2Move[$i] & " To " & $sDestPath & "\" & $sNewName & "."& $sExt & ".jpg", 0)

$iError = FileMove ( $sSourcePath & "\" & $aFiles2Move[$i], $sDestPath & "\" & $sNewName & "."& $sExt & ".jpg" , 0 )

The code above produces the following result...

The MsgBox shows:

K:\_JPG\050202\010.jpg To K:\_JPG\Renamed\20050203-154918.005.jpg

The FileMove command fails and the next lines of code

If $iError < 1 Then
    _FileWriteLog($sSourcePath & "\" & "ErrorList.TXT", $sSourcePath & "\" & $aFiles2Move[$i] & " to " & $sDestPath & "\" & $sNewName & "."& $sExt & ".jpg" )

    $iErrorCount = $iErrorCount + 1
EndIf

writes an entry to the error log.

2005-02-03 15:50:23 : K:\_JPG\050202\010.jpg to K:\_JPG\Renamed\20050203-154918.005.jpg

The Source and Destination paths are correct, the destination file name is generated on the fly, the 3 digits between the two periods are incremented as needed to deal with multiple moves/renames in a given second.

Can anyone tell me what is wrong with my code?

Edit: H'mmmn, a smart Alec (like me) might say yes and nothing further. :lmao: I hope to get the reason too. o:)

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites



Perhaps you need the overwrite flag?


Who else would I be?

Share this post


Link to post
Share on other sites

Perhaps you need the overwrite flag?

<{POST_SNAPBACK}>

On your suggestion, I tried that with no change in result. o:) You couldn't know it, but the destination file name is based on the current time at the point of MOVE. The destination folder is currently empty. :lmao:

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites

What was your problem again?

Does the file not move?

It could be a bug, but I won't jump to that conclusion now.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

What was your problem again?

Does the file not move?

It could be a bug, but I won't jump to that conclusion now.

<{POST_SNAPBACK}>

The file does not move, whether or not the destination is in the same folder, or different folders.

Edit: I also am hesitant to consider a problem to be a bug.

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0