Check file properties for admin requirement

I am making a program that will open other programs, but some of them require administrator rights to open. I would like my program to be able to check if a file requires admin rights, and if it does then not open it. Is there a way to do this?
You can obtain the permissions with std::filesystem::file_status::permissions() if C++17 library support is available. This is unlikely, so consider using the Boost.Filesystem equivalent
http://en.cppreference.com/w/cpp/filesystem/file_status/permissions
http://www.boost.org/doc/libs/1_64_0/libs/filesystem/doc/reference.html#file_status-observers

Less preferably, use POSIX stat(2)
http://pubs.opengroup.org/onlinepubs/009695399/functions/stat.html
Or even less preferably,
GetFileSecurity() if you're on Windows.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa446639(v=vs.85).aspx
Last edited on
Topic archived. No new replies allowed.