Run Process with Administrator privileges in C#

on Oct 29, 2018 12:09 AM

Hi, I am having an web application which requires run as administrator for running few cmd lines. Locally it works fine. Now when I deployed it to IIS server. It is not running. The reason is it's not running the project in administration mode. Please suggest some solution. It's mandatory for my application to run in administration mode.

var startInfo = new System.Diagnostics.ProcessStartInfo
    UseShellExecute = false,
    Verb = "runas",
    WorkingDirectory = @"C:\\OracleATS\\openScript",
    WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
    FileName = "cmd.exe",
    RedirectStandardInput = true,
    RedirectStandardOutput = true,
    RedirectStandardError = true,
    Domain = "mydomainname",
    UserName = Environment.UserName,
    Password = secureString


Download FREE API for Word, Excel and PDF in ASP.Net: Download