How to programmatically set Admin privilege for exe (Vista)
-
Hi, I want to make my application compitible for Windows Vista.How do i programmatically enable the property "Run this program as an administrator" in Windows Vista?
Isn't that a choice that the user has to make? If you were able to override the user's level of privilege just imagine what sort of trouble viruses and trojens could create!
Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
-
Isn't that a choice that the user has to make? If you were able to override the user's level of privilege just imagine what sort of trouble viruses and trojens could create!
Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
-
Thank you, Colin Angus Mackay for the quick response.I want to set admin privileges only to the exes of my application. How can this have adverse effect!
Becuase if any .EXE could just raise it's own privileges, any virus could do that same and do catastrophic damage to the O/S!! What you want to do cannot be done because you cannot raise your privileges to anything abouve what the user already has. The user has to turn this option on outside of your code.
Dave Kreskowiak Microsoft MVP - Visual Basic
-
Becuase if any .EXE could just raise it's own privileges, any virus could do that same and do catastrophic damage to the O/S!! What you want to do cannot be done because you cannot raise your privileges to anything abouve what the user already has. The user has to turn this option on outside of your code.
Dave Kreskowiak Microsoft MVP - Visual Basic
-
If it is possible, i will be making the admin privilege settings at the time of installation after getting the user's permission.Will that have any security breach.
Again, you can't do it from your code, even in the installation. A user cannot grant permissions above his own account.
Dave Kreskowiak Microsoft MVP - Visual Basic
-
Thank you, Colin Angus Mackay for the quick response.I want to set admin privileges only to the exes of my application. How can this have adverse effect!
sp_ranjan wrote:
I want to set admin privileges only to the exes of my application
Then it must be run as Admin
sp_ranjan wrote:
How can this have adverse effect!
Because it could take over the user's machine without the user realising. If you need your application to run as admin you have to ask permission from the user. The user then has to make a judgement whether to trust your code.
Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos