473,396 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Running External Applications in ASP.NET

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!
Nov 17 '05 #1
2 1201
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!

Nov 17 '05 #2
Thanks for the reply, I'll do what you recommended...
-----Original Message-----
System.Diagnostics.Process should work for command line apps.Apps that display UI will generally not work, because ASP.NET does not havea 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 thecheckbox that says "Allow Service to Interact with Desktop"
Also, make sure the ASPNET user account has the necessary permissions to theprogram'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 messagenews: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!

.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: S. van Beek | last post by:
Dear reader, In case an application is ussing an external model library you have to address this external model library in your application. This addressing takes place in a module of the...
16
by: TB | last post by:
Hi all: If you think that the following comments are absolute amateurish, then please bear with me, or simply skip this thread. A couple of months back I made the decision to initiate a...
4
by: Robert Samuel White | last post by:
Hi there. Can anyone point me to some good references or examples on how to create an independent tray program that can send triggers to external applications all designed inside the same...
1
by: mikelujan | last post by:
Hi, Our application starts an external application using System.Diagnostics.Process class and the Start() method, as per code snippet below. This application run as a Windows service, and must...
9
by: Jimmy | last post by:
Well, i know it may be a little non-python thing, however, I can think of no place better to post this question :) can anyone tell me, in python, how to obtain some information of a running...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.