Error when executing Process.Start() when running 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 executing Process.Start() when running under SYSTEM account.

  • dotnetnubie

    Why are you trying to load Excel as a window when no one will see it Why not put the macro in an external vbscript... or open Excel using COM Interop.

    I haven't tried to open Excel using localsystem. My guess to why it fails it that localsystem doesn't have a profile. Try running it under a user account with Admin priviledges.

  • Error when executing Process.Start() when running under SYSTEM account.