Executing a process in windows server 2003 and ii6 from code - permissions error

Posted by kurupt_89 on Stack Overflow See other posts from Stack Overflow or by kurupt_89
Published on 2012-04-04T23:17:07Z Indexed on 2012/04/04 23:29 UTC
Read the original article Hit count: 169

I have a problem executing a process from our testing server. On my localhost using windows XP and iis5.1 I changed the machine.config file to have the line -

I then changed the login for iis to log on as local system account and allow server to interact with desktop. This fixed my problem executing a process from code in xp.

When using the same method on windows server 2003 (using iis6 isolation mode) the process does not get executed.

Here is the code to execute the process (I have tested the inputs to iecapt through the command line and an image is generated) -

    public static void GenerateImageToDisk(string ieCaptPath, string url, string path, int delay)
    {
        url = FixUrl(url);
        ieCaptPath = FixPath(ieCaptPath);
        string arguments = @"--url=""{0}"" --out=""{1}"" --min-width=0 --delay={2}";
        arguments = string.Format(arguments, url, path, delay);
        ProcessStartInfo ieCaptProcessStartInfo = new ProcessStartInfo(ieCaptPath + "IECapt.exe");
        ieCaptProcessStartInfo.RedirectStandardOutput = true;
        ieCaptProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
        ieCaptProcessStartInfo.UseShellExecute = false;
        ieCaptProcessStartInfo.Arguments = arguments;
        ieCaptProcessStartInfo.WorkingDirectory = ieCaptPath;
        Process ieCaptProcess = Process.Start(ieCaptProcessStartInfo);
        ieCaptProcess.WaitForExit(600000);
        ieCaptProcess.Close();
    }

© Stack Overflow or respective owner

Related posts about c#

Related posts about process