How to start a new process in an asp.net web application

  • Thread starter Thread starter seemorgh
  • Start date Start date
S

seemorgh

Guest
The default browser on our web servers is IE. We have a requirement to launch an instance of Chrome on a button click on our web apps.

I have written an asp.net test app to try to achieve the above. In the test app I start a process on a button click on the server side to launch Chrome, but the Chrome window does not appear. The process seems to start fine as I get the the process ID and HasExited property is false. However, nothing comes up on screen and I don't seem to be able to find the process in the list of processes.

I know that in a web app, a process starts in the context of the asp.net worker process and that it does not have access to the desktop and has restricted permissions. So I gave the IIS Admin Service process permission to interact with desktop on my local machine (via Processes window). Also, in the code I tried starting the process using my own user account which has admin access to the local machine but still could not get the Chrome window to appear on screen.

My server side code is as follows:

var psi = new ProcessStartInfo
{
FileName = @"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",
Arguments = "MSN | Outlook, Office, Skype, Bing, Breaking News, and Latest Videos",
CreateNoWindow = false,
UseShellExecute = true
UserName = "username",
Password = "secure password",
Domain = "domain"
};
var process = new Process
{
StartInfo = psi
};
var result = process.Start(); // result is true
int processId = process.Id; // processId is valid
I would appreciate your help.

Continue reading...
 
Back
Top