I have a Windows 2008 box running IIS7. The server hosts an ASP.NET application that absolutely needs to fire up an external process - an executable located in this same machine.

This setup works fine in the ASP.NET development server, but fails thoroughly when IIS is involved. I've tried everything: modifying the machine.config file, changing the app Application Pool's identity, playing around with file and folder permissions, changing the settings in the service's "Log On" tab... nothing works.

It doesn't matter which executable I try to run, either. Even "notepad.exe" fails.

I'm probably missing something, because a task so trivial shouldn't be this hard. Yes, I'm aware of the security implications of what I'm trying to do, but in this case there is just no other way.

Thanks in advance.


Check both the app pool identity and the anonymous user's identity on the site. For the site, if you set the anonymous user to use the app pool's identity, that makes things cleaner, as long as you aren't sharing app pools between untrusted sites. Test with your administrative user and make sure that UAC isn't fighting with you. Be sure to set back to a custom user after testing.

Another possible issue can be with how the user profile is loaded from IIS. In the advanced settings for the app pool, experiment with "Load User Profile".

Another thing to try is to run the app through cmd.exe. For example:

var p = new Process();
string command = "notepad.exe";
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.WorkingDirectory = "valid working directory";
p.StartInfo.Arguments = String.Format("/C {0}", command);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy