netninja
March 25th, 2008, 02:20 PM
hello,
I would just like to know if anyone could please tell me how to force the appearance of the UAC permission dialog in Windows Vista. Usualy the dialog will appear if you right click any executable and click "Run as administrator" but when you just double click like normal it won't. My program needs to be running with administrator privilege, so if this privilege is not given I would like to be able to exit cleanly. I have written some code to detect whether the process is running with administrator privileges (detects both admin account token and admin process token) and it works well.
But I know out of instinct users tend to just double click to execute an executable rather than right clicking at all. I could tell them they need to right click and click "Run as administrator" but the message still might not get through and might confuse some users who are not using Vista where UAC does not apply.
I purposely wrote the code to detect an admin account token so that I can just exit out and print an error message before the UAC permission dialog is even shown. But I just need some way to make the UAC permission dialog appear even if the executable has just been double clicked.
Does anyone know how I can make it appear even when I don't explicitly run the program as administrator? thanks.
I would just like to know if anyone could please tell me how to force the appearance of the UAC permission dialog in Windows Vista. Usualy the dialog will appear if you right click any executable and click "Run as administrator" but when you just double click like normal it won't. My program needs to be running with administrator privilege, so if this privilege is not given I would like to be able to exit cleanly. I have written some code to detect whether the process is running with administrator privileges (detects both admin account token and admin process token) and it works well.
But I know out of instinct users tend to just double click to execute an executable rather than right clicking at all. I could tell them they need to right click and click "Run as administrator" but the message still might not get through and might confuse some users who are not using Vista where UAC does not apply.
I purposely wrote the code to detect an admin account token so that I can just exit out and print an error message before the UAC permission dialog is even shown. But I just need some way to make the UAC permission dialog appear even if the executable has just been double clicked.
Does anyone know how I can make it appear even when I don't explicitly run the program as administrator? thanks.