user3024698
user3024698

Reputation: 89

Run Program as Administrator in vb.net

I am programming with vb.net . I have a program which needs Administrator Privileges

I want: If program started then a Prompt Show (UAC(User Account Control)) shows that it have to tun as administrator. Is it possible?

Upvotes: 7

Views: 39501

Answers (2)

BaeFell
BaeFell

Reputation: 650

You can do the following to make sure the program has admin permissions:

You can edit the UAC Settings (in VB 2008), which is located in the Project Settings. Look for the line that says

Change level="asInvoker" to:

level="asInvoker" (normal account - default)

level="requireAdministrator (require administrator - What you need... but could be next one)

level="highestAvailable" (if anything is higher then administrator, require that)

Hope it helps :)

-nfell2009

Upvotes: 7

user2562950
user2562950

Reputation: 11

None of the project settings suggestions worked for me in Windows 10 64 bit. I changed to Release, I replaced "asInvoker" line with "requireAdministrator" line and still was getting Access Denied Exceptions. The only way to run thru VS2013 is to run the environment off the bat AS AN ADMINISTRATOR.

Upvotes: 1

Related Questions