Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c sharp exe should ask for "run as administrator" prompt when opened

I am having an exe generated by a c sharp program. when i run the exe, i want an UAC prompt to appear with an option to run the exe as administrator. I have seen examples of running an exe as admin by default. But, how do i enable the UAC to ask me for running the exe as admin? Any idea?

like image 380
Harish Kumar Avatar asked Jan 10 '12 11:01

Harish Kumar


1 Answers

You need to add "Application Manifest File". Step-By-Step

  • Right-Click on your project
  • Add "New Item"
  • Select "Application Manifest File"
  • Find this
  • change level="requireAdministrator"
like image 165
Pongsathon.keng Avatar answered Oct 14 '22 09:10

Pongsathon.keng