PDA

View Full Version : Move File(s) Errors



NewsArchive
05-04-2011, 01:46 AM
I am attempting to use the "Move File" function and %_SB_ERRORCODE% is
returning a zero. This of course means the function failed. I believe
the "Move Folder" function behaves the same way.

How do I figure out "WHY" it failed?

Thanks.

--
*Regards*,

Lee
www.cya2day.com
CYA - Don't Leave Home Without One

NewsArchive
05-04-2011, 01:47 AM
Lee,

> I am attempting to use the "Move File" function and %_SB_ERRORCODE% is
> returning a zero. This of course means the function failed. I believe
> the "Move Folder" function behaves the same way.
>
> How do I figure out "WHY" it failed?

Yes, if the MoveFile Windows API fails, the return value is zero.

http://msdn.microsoft.com/en-us/library/aa365239(v=vs.85).aspx

%_SB_ERRORCODE% holds the return value of MoveFile. What you can try it to
in this MoveFile scenario is to call the GetLastError Windows API (using
"Call DLL...") and see if this provides more information.

The GetLastError codes are listed here:

http://msdn.microsoft.com/en-us/library/ms681381(v=vs.85).aspx

In the attached screenshot, the file to be moved does not exist and the
GetLastError code (%_SB_RETURN%) is 2 (ERROR_FILE_NOT_FOUND -> 2)

Friedrich

NewsArchive
05-04-2011, 10:32 AM
Thank you.....

*Regards*,

Lee
www.cya2day.com
CYA - Don't Leave Home Without One