System.Diagnostics.Process should work for command line apps.
Apps that display UI will generally not work, because ASP.NET does not have
a desktop to run under.
To give it access to a desktop, thereby allowing most apps to run, try this:
Go into control panel, administrative tools, services.
Find all the WWW related services and, in their properties, check the
checkbox that says "Allow Service to Interact with Desktop"
Also, make sure the ASPNET user account has the necessary permissions to the
program's folder and any other folders that that program uses.
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at
http://www.able-consulting.com
"Edward" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
I'm trying to execute an application on the server side in
asp.net. For a simple test, I wanted to run notepad.exe
which I copied from the windows directory to my web app
directory. Here's the code snippet of my webforms
page_load event:
Process myp = new Process();
myp.StartInfo.FileName = "notepad.exe";
myp.StartInfo.WorkingDirectory =
@"c:\inetpub\wwwroot\loanimporttool";
myp.EnableRaisingEvents = true;
myp.Start();
everytime I run this, Notepad runs on the background but
the window doesn't show up. If you try to run the same
code in a windows app, it works. What am I doing wrong?
Any help would be appreciated. Thanks!