Error when using Process.Start() under SYSTEM account

I have an ASP.Net page using the System.Diagnostics.Process class to execute an Excel file with no arguments, I/O redirection, or direct impersonation. I have setup the web app to run under the SYSTEM (Local System) account via an Application Pool in IIS 6.0. The Excel file has a macro that will run automatically when opened. The web page is actually going to start a ProComm session, executing a script, to telnet to various telcom exuipment and gather info then call. Once the ProComm script has gathered all info it calls the same Excel file. The ASP.Net page needs to run under the SYSTEM account to allow the ProComm process to interact with the destop and have elevated system access. It failes without this authority. It (ProComm) has no problems running now.

However, when the ProComm process or the ASP.Net page, directly, call the Excel file it fails with a generic error window that states "
Microsoft Office Excel has encountered a problem and needs to close. We are sorry for the inconvenience." It asks if the program should be restarted with or without sending an error or you it should be debugged. Not matter what Excel continues to fail. I have observered that both the ProComm session and Excel are started under the SYSTEM account (being derived from the credintals of the web process for the ASP.Net page.

Can someone explain to me the reason for Excel to fail to open while running under the SYSTEM account while ProComm works perfectly If it is a conflict with using the SYSTEM account is there another method to give the ProComm process SYSTEM type access while not inhibiting Excel

Example or links would be appreciated. Thanks in advance for your assistance.

Dim process As New Process()
process.StartInfo.FileName = fileName 'Path and file name as String
process.StartInfo.UseShellExecute = False
process.StartInfo.RedirectStandardInput = False
process.StartInfo.RedirectStandardOutput = False
process.StartInfo.RedirectStandardError = False
'process.StartInfo.Arguments = args 'String of associated command line arguments
process.StartInfo.CreateNoWindow = False
process.Start()
'process.WaitForExit()



Answer this question

Error when using Process.Start() under SYSTEM account

  • Drance

    I'm not sure but I think that Excel need to have an open session to work.

    Have you try to run your ASP.NET application while you are logged on the server running the application



  • crispi

    Where have to set the web application's acount

  • Chaepp

    Under IIS 6.0 the web app is set to run as SYSTEM (Local System) by selecting an Application Pool, I custom made, that is set to run as Local System. This is not done in code or in the web.config or machine.config. I have made App Pools for varying security levels (NETWORK SERVICE, LOCAL SERVICE, LOCAL SYSTEM) in order of least to most permissions. Most of my apps and ASP.Net by default run in the NETWORK SERVICE acccount. This is set under the Identity tab in the properties for the selected App Pool.


  • Scott Allen

    The following article explains some of the problems you can encounter when trying to automate Office server-side:

    http://support.microsoft.com/default.aspx scid=kb;EN-US;q257757#kb2

    Specifically Office needs to run from an account with a user profile.


  • Error when using Process.Start() under SYSTEM account