Executing EXE from ASP.NET

I would like to execute exe from an ASP.NET MVC application. Yes, I understand that the inherent risks do this, but unfortunately I really need to do this.

The EXE is a graphical application, but the arguments I pass make it run silently, where it generates some data in a zip file and then exits.

The code for executing the EXE is as follows: it works fine in VS2008 in my development window, but when I test the actual server (Server 2003 - IIS6), it fails:

        ProcessStartInfo psi = new ProcessStartInfo();
        psi.FileName = "C:\.....";
        psi.Arguments = "-silent -file outFile.zip";

        Process proc = new Process();
        proc.StartInfo = psi;
        proc.Start();

        proc.WaitForExit();
        log.Debug("Process exited: " + proc.ExitCode);

Exit code: -532459699, so something obviously went wrong.

HTTPS- ( ), , , <identity impersonate="true" /> Web.config <system.web> . - .

- .

+3
4

, , . ( -silent...), .

( , -silent),

0
+8

, exe NetworkService ( , ...)

( sysinternals processmonitor), .

+1

Impersonate WindowsIdentity . , .exe . , ( , ) .

0

All Articles