What Windows API function can I use to check to see if the current user running my application has administrative privileges?
Here are my OS details : WINDOWS XP, VISTA and WINDOWS 7
Language to be used : C
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Even if the user has administrative privileges it does not mean your program does – it needs to be elevated. This can be done by the user explicitly asking to run it as an administrator, but usually it is requested by the program itself through a manifest that is embedded into the executable. Once the manifest asks for the privileges it is not optional – the program will not run until the user has approved it and supplied the password as necessary.