Click here to Skip to main content
15,936,709 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi All,

I have a simple question.

I finished my application and created a Setup using Setup Project in Visual Studio.

The problem is that I need to set the application to run as Administrator 'cause it creates a file on running and Windows don't allow me to do it.

When I click with the right button on the .exe and select "Run as Administrator" everything works perfectly, but every time I have to do it, and it will be impossible for the user to go to the root folder and do it every time it wants to use the application. :(

Can someone help me?

Thanks in advance! :)

Well, AFAIK, it's the operating system that restricts it and you cannot do anything.

Think this way, if you were allowed to let any application run under administrator account by itself then how vulnerable your system would be from software attacks!
Share this answer
No you cannot do this via code.
If you could, then it would not be a security check, would it?
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900