473,396 Members | 1,734 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.

Old Dos Program from asp.net website

I have a requirement to execute a legacy DOS program from within an
ASP.NET Website. I have it working in my sandbox machine but when I
put it live and select the option via asp:button the site simply
refreshes and no new window with said DOS application appears. The
application is present in the task list on the server. The
environement is windows 2003 with IIS 6.0. I have checked the 'Allow
serviec to interact with desktop' check box in the IIS Admin services
and have modified the machine.config process model tag to
<processModel userName="SYSTEM" password="AutoGenerate" /as per the
msdn article 'Unable to Start a Process from ASP.NET' (not sure that
is exactly what I should put). I have tried to modify the IIS_WPG
group to allow system privileges and even assigned it adminstrator
rights for a bit to see if that did anything. I have also played
around with the ASPNET account in IIS and gave in admin privileges to
see if that does anything. I added the process code that starts the
app below but since I see it in the task list I assume that is good.
I can't think of anything else I can do any help would be appreciated.

System.Diagnostics.Process cmd = new System.Diagnostics.Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.UseShellExecute = false;
bool started = cmd.Start();
if (started)
{
Button btn = (Button)sender;
string arg1 = btn.CommandArgument.ToString();
cmd.StandardInput.WriteLine(@"D:\wincmd\TotalCmd.e xe",
arg1);
cmd.StandardInput.Flush();
cmd.StandardInput.Close();
}

Sep 13 '07 #1
8 1488
"wmotter" <wm*****@prolist.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
I have a requirement to execute a legacy DOS program from within an
ASP.NET Website. I have it working in my sandbox machine
What are you actually expecting to happen here...?

Presumably, your sandbox machine is the one at which you're sitting while
you're developing...?
System.Diagnostics.Process cmd = new System.Diagnostics.Process();
Which will try to run on the webserver, not a client machine...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 13 '07 #2
On Sep 13, 12:11 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"wmotter" <wmot...@prolist.comwrote in message

news:11**********************@g4g2000hsf.googlegro ups.com...
I have a requirement to execute a legacy DOS program from within an
ASP.NET Website. I have it working in my sandbox machine

What are you actually expecting to happen here...?

Presumably, your sandbox machine is the one at which you're sitting while
you're developing...?
System.Diagnostics.Process cmd = new System.Diagnostics.Process();

Which will try to run on the webserver, not a client machine...

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Thanks for the response. I am running my website local (localhost on
the 'sandbox' machine) using IIS 5.0 and what happens is a second
window pops with the dos application executing when I select a button
on the asp.net website. You have raised an issue I am unsure about
and that is running a DOS app from an asp.net web site. Can I execute
a dos app on the web server from an asp.net website so that an
individual can view/use it from their client machine. I would think
there might be something inherently prohibited about this from a
security standpoint but maybe that is why I need to jump through all
of these permission hoops. BTW, I log on as sys admin to the web
server that is running the live site in question and try to execute
this scenario to no avail. This server is an internal server not
accessible outside of the office.

Sep 13 '07 #3
"wmotter" <wm*****@prolist.comwrote in message
news:11*********************@w3g2000hsg.googlegrou ps.com...
Thanks for the response. I am running my website local (localhost on
the 'sandbox' machine)
That's what I thought...
Can I execute a dos app on the web server from an asp.net website...
Yes.

....so that an individual can view/use it from their client machine.

No.
I would think there might be something inherently prohibited about this
from a security standpoint but maybe that is why I need to jump through
all
of these permission hoops.
It's nothing to do with security - it's simply that ASP.NET is running on
the server, and that's where any processes which ASP.NET initiates will
run...
BTW, I log on as sys admin to the web server that is running the live site
in
question and try to execute this scenario to no avail.
That won't make any difference.
This server is an internal server not accessible outside of the office.
Irrelevant...

What does this DOS app do? Why does someone need to watch it run...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 13 '07 #4
re:
!...so that an individual can view/use it from their client machine.

!No.

The standard output (stdout) could be captured and displayed, couldn't it ?


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message news:%2******************@TK2MSFTNGP02.phx.gbl...
"wmotter" <wm*****@prolist.comwrote in message news:11*********************@w3g2000hsg.googlegrou ps.com...
>Thanks for the response. I am running my website local (localhost on
the 'sandbox' machine)

That's what I thought...
>Can I execute a dos app on the web server from an asp.net website...

Yes.

...so that an individual can view/use it from their client machine.

No.
>I would think there might be something inherently prohibited about this
from a security standpoint but maybe that is why I need to jump through all
of these permission hoops.

It's nothing to do with security - it's simply that ASP.NET is running on the server, and that's where any processes
which ASP.NET initiates will run...
>BTW, I log on as sys admin to the web server that is running the live site in
question and try to execute this scenario to no avail.

That won't make any difference.
>This server is an internal server not accessible outside of the office.

Irrelevant...

What does this DOS app do? Why does someone need to watch it run...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 13 '07 #5
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:u9**************@TK2MSFTNGP03.phx.gbl...
re:
!...so that an individual can view/use it from their client machine.

!No.

The standard output (stdout) could be captured and displayed, couldn't it
?
Oh sure, but I got the impression that the OP needs to have user interaction
with the DOS app...

Obviously if that's not the case, then this will present no problem at
all...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 13 '07 #6
re:
!Oh sure, but I got the impression that the OP
!needs to have user interaction with the DOS app...

That won't happen, as you well know...

;-)


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
"Juan T. Llibre" <no***********@nowhere.comwrote in message news:u9**************@TK2MSFTNGP03.phx.gbl...
>re:
!...so that an individual can view/use it from their client machine.

!No.

The standard output (stdout) could be captured and displayed, couldn't it ?

Oh sure, but I got the impression that the OP needs to have user interaction with the DOS app...

Obviously if that's not the case, then this will present no problem at all...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 13 '07 #7
"wmotter" <wm*****@prolist.comwrote in message
news:11*********************@50g2000hsm.googlegrou ps.com...
The DOS app needs to be local on each machine that is going to use it
(not a problem since it is an interanl app).
Ah...
But the question remains can a web app start a local copy of a DOS app
with .net?
Absolutely not natively, for fairly obvious security reasons - "format c:"
is a useful utility, but you wouldn't want a website to be able to execute
it on client machines... :-)

Your only hope with this is to write an ActiveX control (or Java applet if
you're not using IE) which will kick the DOS app off, but you'll need to
ramp down your browser security for this...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 13 '07 #8
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eo**************@TK2MSFTNGP03.phx.gbl...
Your only hope with this is to write an ActiveX control (or Java applet if
you're not using IE) which will kick the DOS app off, but you'll need to
ramp down your browser security for this...
Or you might be able to use the WSH (Windows Scripting Host) Shell object to
launch it:
http://www.pcsupportadvisor.com/Wind...host_page2.htm
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 13 '07 #9

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

Similar topics

0
by: shwekhaw | last post by:
Hi I have a retail website. I like to automate daily price file download and price update. Products listed on the site are shipped from four different distributors. So the final program will...
1
by: gaosul | last post by:
I am non-programming scientist and I am using a Program called Easyarticles from Synaptosoft Inc., which is based the database program Access. Unfortunately, the owner of this company has...
8
by: yxq | last post by:
Hello everyone I ever found a website that provide the technology of running program without installing framework, but now i forgot the URL, does everyone know the technology and the website? ...
1
by: rob | last post by:
I have a program from which I would like to fill edit boxes, chose from combo boxes and select radio buttons of a website and then do a submit. Point in case is etrade.com where I would like to be...
0
by: gguan123 | last post by:
Recommend an excellent ASP program gives everyone:Webmaster club news system v5.09 demo:http://www.caifuw.com/en/new/ download:http://dow.caifuw.com/new5.09freeEn.rar Categories:asp(news system)...
1
by: ashokingroups | last post by:
Hi In my program, I need to print the current number of active users at this website, means How many number of people are currently accessing the website. Can anyone please tell the solution: How...
0
by: Yiyu | last post by:
Hi, I am a newbie here. Here what I want to do and I wonder if it's easy to be achieved using Windows Presentation Foundation: I am going to teach a college course and I want to do real time...
1
by: scottdavid88 | last post by:
Ok, I am not sure if this is in the right forum or not (please feel free to move it where it would be more appropriate). I need help finding a program or maybe some guidance on where to look or...
11
by: KillSwitch | last post by:
Is it possible to make a program to search a site on the internet, then get certain information from the web pages that match and display them? Like, you would put in keywords to be searched for on...
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
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.