PDA

View Full Version : Rename Folder I get SB_ERRORCODE = 603



torrid
01-26-2017, 10:01 AM
Hi,

The help file says:
If the function succeeds, the %_SB_ERRORCODE% return value is nonzero.

If the function fails, the return value is zero.

But I find that it returns zero and the folder was not renamed.
So I tested the opposite... and the errorcode = 603 and the folder is not renamed.

Also, it is not due to a process using it... I tested renaming it by hand in Windows explorer and killed all processes in Resource Monitor that were preventing it from being renamed until I could rename it manually from explorer.

RELATED QUESTION

I have long time installed user files in Documents under company name then app name but I have renamed my app.
If the folder with the OLD name exists, I want to rename it to the new name and have my software stop using the old folder tree entirely.
But to do that I have to have this rename work.... if the rename fails, I can install to new folder tree but user data will be in old tree...
I guess at end of installer I can try to detect that and copy over the files?

Anyone try to depend on renaming a folder and have a lot of problems with users because of that???

-Tim

linder
01-27-2017, 04:01 AM
Hi Tim,

IMO, errorcode = 603 does not come from your "Rename File/Folder" function when you rename a folder.

See attached screenshots. The installer tries to rename the c:\test folder to c:\testX

Test 1: the c:\test folder does NOT exist. The function fails, the return value is "0".

Test 2: the c:\test folder exists and is NOT locked. The function renames c:\test to c:\testX (success) and the return value is "1".

Test 3: the c:\test folder exists but is locked. The function fails, the return value is "0".

BTW, return value 603 is not defined for the MoveFile Windows API.

Friedrich

linder
01-27-2017, 04:11 AM
BTW, Error Code 603 is defined in the detect active application / kill active application components.

Friedrich