简体   繁体   中英

System.Diagnostics.Process.Start Access Denied

I have a Web Application running under IIS on a Azure VM. It is attempting to execute a Windows32 application. When I run the application, I always get this exception -> system.diagnostics.process.start access denied. I have tried to execute the program in a command prompt shell and it works without having to be run under administration.

The code -

string fileIn = us_post_directory + loan.loan_file;
string fileOut = us_ocr_directory + loan.loan_file;
string password = loan.password;

var p = new System.Diagnostics.Process
{
    StartInfo =
    {
        UseShellExecute = false,
        FileName = "C:\\Program Files <x86>\\PlotSoft\\PDFill\\PDFill.exe",
        //FileName = "E:\\PlotSoft\\PDFill\\PDFill.exe",
        Arguments =
            String.Format(" DECRYPT \"{0}\" \"{1}\" -password \"{2}\"", fileIn, fileOut,
                password)
    }
};
p.Start();

Web Applications run under the context of IIS, which does not have access to many of Windows sub-systems. You will need to configure IIS, specifically the AppDomain for the site, to run as a service account that you create and give permissions to. Depending on the application, the service account will probably need a user profile and permission to access too. Some of these steps require using gpedit to configure your local machine policy or domain policy.

The exact steps and permissions needed will depend on the application you are trying to run and what it expects to have access to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM