My program must be run as administrator and creates some files. If I run it manually by right-click on the icon and selecting "run as administrator" -- everything okay -- all users have access to created files. But if program launched from the another program by ShellExecuteEx with "runas" verb -- created files have no access entry for BUILTIN\Users group. Only administrator users can read those files.
2
votes
That really depends on how you've utilized the UAC of Windows, if your application is "Native C++ Program" or has used .NET APIs (in case you use Visual C++).
– Kushal
It's native C++ program. Only WinAPI used
– Newbee
I think there's no point in trying to fix it. Microsoft will screw it up again whatever you do. Consider that according to report in Wikipedia article on UAC, it's likely that it was just designed to be very visibly show users that Windows is doing something about security, i.e. designed to be annoying and to screw things up.
– Cheers and hth. - Alf
1 Answers
0
votes
Why not setup the linker flag (VC2008 and higher): Linker -> Manifest -> UAC Execution Level: requireAdministrator (/level='requireAdministrator')
EDIT: I re-read the question, and found that problem is probably with NTFS file-security. This is not your program's fault, but this is by design. Any user who creates files and folders is given permissions to that user only.
Login as administrator user, create a folder. Then re-login as another user (however you like), and try to access/read/write/delete that folder - you cannot. The permissions are granted to administrator user, and not to everyone/users-group.