473,508 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to detect that a DOS process is waiting for input

Hi,

My app runs a DOS program as a process. Most of the time, given the right
command line arguments, the DOS process runs by itself without needing any
user intervention, but there is a certain situation that can arise where it
expects the user to respond "y" or "n" to a question. Is there any way to
detect that the process is waiting for this user input?

Thanks

Matt
Jul 21 '05 #1
2 2397
"Matt Burland" <wjousts@[nospam]hotmail.com> wrote in
news:uH*************@tk2msftngp13.phx.gbl:
question. Is there any way to detect that the process is waiting for
this user input?


When you start the DOS app with the System.Process class, you can have it
redirect the standard input and output. From that you can monitor the text
that is output by the DOS app and if it is asking a question then you can
respond with the answer.

Chris
Jul 21 '05 #2
Thanks, but that's what I'm doing. I was looking for something more general
that didn't rely on me having prior knowledge of what the output is going to
be.

"Chris Dunaway" <du******@lunchmeatsbcglobal.net> wrote in message
news:Xn**********************************@207.46.2 48.16...
"Matt Burland" <wjousts@[nospam]hotmail.com> wrote in
news:uH*************@tk2msftngp13.phx.gbl:
question. Is there any way to detect that the process is waiting for
this user input?

When you start the DOS app with the System.Process class, you can have it
redirect the standard input and output. From that you can monitor the

text that is output by the DOS app and if it is asking a question then you can
respond with the answer.

Chris

Jul 21 '05 #3

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

Similar topics

18
4856
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE)...
4
6560
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
3
2951
by: felixfix | last post by:
Hi all, I am just wondering if something is wrong with my program. What it bascially does is to output a fibonacci sequence base on the command-line output. If I give a 5, it will generate the...
3
1815
by: Richard Thornley | last post by:
Hello, I was just been given a project and I have some questions on how to accomplish the first part of the task. If a user sends an email to a specific email address I need to detect...
2
331
by: Matt Burland | last post by:
Hi, My app runs a DOS program as a process. Most of the time, given the right command line arguments, the DOS process runs by itself without needing any user intervention, but there is a certain...
2
2063
by: Andy | last post by:
I have the following lines of code: System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = "intupld.exe"; process.StartInfo.Arguments = hupFile;...
12
4509
by: bhunter | last post by:
Hi, I've used subprocess with 2.4 several times to execute a process, wait for it to finish, and then look at its output. Now I want to spawn the process separately, later check to see if it's...
1
1384
by: StarGhost | last post by:
Hello, I'd like to detect if a process is still running, i.e., it's still calculating or inputing/outputing, means everything except got hang somewhere, or waiting for input. This process is running...
7
6204
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
0
7133
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
7336
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,...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
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,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.