Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to force a .NET Application to run as administrator ?

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 291
    Comment on it

    "Force a .NET Application to run as administrator "

        While working on a .Net app, I got a requirement to make the app to run as administrator.

    The solution I found is as follows:

    Step 1: Create your .Net Application.

    alt text

    Step 2: Now right click on the project and go to Add New Item.

    alt text

    Step 3: Select Application Manifest File.

    alt text

    Note:-> An Application Manifest is a XML file. It contains the description of all the assemblies which are bidden with the application at runtime.

    Step 4: Now open the Application Manifest File and search for <requestedExecutionLevel>:

    What you will see is as follows:

    <requestedExecutionLevel level="asInvoker" uiAccess="false" />
    

    Now instead of "asInvoker" write "requireAdministrator" i.e.

    <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
    

    Now when you will start your app it will run as administrator.

    Hope it helps..!

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: