How do I get the return value of Run As Administrator. I am using ShellExecute to run cmd as administrator from a c++ program.
How can I tell if the user clicked 'no' or 'yes' in the User Account Control?
This is my code:
1 2 3 4 5 6 7 8 9 10 11
if( ShellExecute(0, "runas", "cmd.exe", "/k color ?", 0, SW_SHOW) == ERROR_SUCCESS )
{
// some code here to determine if yes or no
// if( UAC == YES )
{
printf("Color help found\n");
exit(1);
}
else
exit(3);
}