On Wed, Mar 5, 2014 at 11:09 PM, Roger Bilau <sf@bilau.de> wrote:

when attempting to move files with SysFileMove, I get a RC=5 and with SysGetErrorText the message 'Access denied’.


If I instead use ‘MOVE /Y source target’ in the same rexx script, it run successfully.

Drag and drop in the windows explorer also run successfully.


The owner of the files, I like to move, is the same user, with which I opened the command prompt.

If I opened a command prompt as an administrator, the script with SysFileMove is also not running.


Is this a bug?

When I get a chance, I'll take a look at what API SysFileMove uses.  It does seem odd that it would work with MOVE and not with SysFileMove.  Have you tried using it when you are not going to overwrite an existing file.

When you move a file, it doesn't make any difference if you are the owner of the file, if the destination is not allowed.  That is the most likely reason for the error.  The Windows API being used probably does not allow the move if it is going to overwrite and existing file.

Mark Miesfeld.