Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

c# open app as administrator windows 10

SubZero answered on March 4, 2023 Popularity 3/10 Helpfulness 2/10

Contents


More Related Answers

  • easily start admin process from service c#
  • desktop icon to start as administrator
  • how to run a function as administrator in c#
  • c# request run as administrator
  • c# run program as an administrator
  • check if app have administrator rights c#
  • How do I force my .NET application to run as administrator?
  • read administrator account remote machine C#

  • c# open app as administrator windows 10

    0

    n C#, you can open an application as an administrator on a Windows 10 machine by modifying the application manifest file.

    Here's an example:

    1- Right-click on your project in Visual Studio and select "Add" -> "New Item".

    2- Select "Application Manifest File" and click "Add".

    3- Open the manifest file (app.manifest) and change the requestedExecutionLevel element to the following: 

    the ProcessStartInfo class is used to specify the application to launch (FileName) and the verb to use (Verb). The Verb property is set to "runas" to indicate that the application should be run as an administrator. The Process.Start() method is then used to launch the application with the specified settings.

    Note that modifying the application manifest to require administrator privileges may cause compatibility issues or other unexpected behavior, and that you should use caution and appropriate security measures when modifying system-level functionality. Also, note that launching an application as an administrator may require administrator privileges or other system permissions, and that you should use caution and appropriate security measures when working with system-level functions. 

    Popularity 3/10 Helpfulness 2/10 Language csharp
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Mar 04 2023
    SubZero
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.