i have a problem with CopyFiles, i want copy (copy and then delete from "c:\test") some files from a folder to TEMP, but if error raised return back with copy from TEMP to "c:\test".
If a file is locked (i.e. "pdf") delete command from "c:\test" raised an error (but other files are deleted well), and when re-copy from TEMP to "c:\test" copy doesn't function (file locked) and no files are copied.
These are my steps:
CreateDirectory "$TEMP\Backup\"
CopyFiles "C:\Test\*.*" "$TEMP\Backup\"
Retry:
ClearErrors
Delete "C:\Test\*.*"
IfErrors 0 NoError
MessageBox MB_RETRYCANCEL|MB_ICONQUESTION "Error during copy, retry?" IDRETRY Retry:
ClearErrors
SetOverwrite off ;i have tried with ifnewer-on-try, also
;Rollback - re-copy original file from $TEMP
CopyFiles "$TEMP\Backup\*.*" "C:\Test\"
IfErrors 0 NoError
MessageBox MB_ICONSTOP "Error during copy, stop"
Abort
NoError:
MessageBox MB_OK "Copy Ok" Many thank for your help.
Mark