The problem at first glance looks ridiculous. I am writing a simple application in C++. I compiled code. Everything worked perfectly, until I moved the exe to a different partition than the system. I have two partition (C: with system and E: with data, they both are NTFS), from C:, eg. from Desktop, from root of C:\ etc., program doesn't have any problems. From E:\, rename() function throws an error "Access Denied".
To clarify:
- I have full admin rights
- The program is run with administrative rights
- Transferred files aren't used by any process
- The system partition both as E: \ in security policy has granted full rights to the Administrators group and for me personally.
How to solve it?
For example: Games that can save files in the same place doesn't have a problem with that, even without administrator rights.
When I tried uses MoveFileEx I got error with code 5. Code 5 means "Access denied". Also because it's an other partition