0

This has been solved! This was accomplished with the following code:

#include <iostream>
#include <Shlobj.h>

int main()
{
    if (!IsUserAnAdmin)
       {
           // Do stuff
       }

    if (IsUserAnAdmin)
       {
           // Do stuff
       }

Thank you to everyone who commented on the post.

I'm in a bit of a rut with the C++ application I'm developing.

My application requires elevated privileges to function properly, and I'd like to be able to determine if such privileges are present upon runtime. How would I go about doing this? I would like to check immediately after the program is run, and throw an error or proceed with execution (of course)

Thank you for taking the time to respond.

Koi
  • 87
  • 1
  • 9

0 Answers0