Interaction with MS DOS-program

I try to interact with a MS DOS-program.
I try something like this:
// start command running
startCmd = "start command";
Process proc = Runtime.getRuntime().exec(startCmd);
istr = proc.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(istr));           
printCmdLine(br);
out = proc.getOutputStream();
writer = new BufferedWriter(new OutputStreamWriter(out));
writer.write("second command");
writer.newLine();
writer.flush();
printCmdLine(br);
writer.write("third command");
writer.newLine();
writer.flush();                     
printCmdLine(br);
// wait for command to terminate
try {
     proc.waitFor();
catch (InterruptedException e) {
     System.err.println("process was interrupted");
// check its exit value
if (proc.exitValue() != 0)
     System.err.println("exit value was non-zero");
The problem is that I can't read from the InputStream:
private static void printCmdLine(BufferedReader br) throws IOException {
     ArrayList list = new ArrayList();
     String outlist[];
     String str = br.readLine();
The program can't read. The DOS prompt waits for an input from the keyboard and nothing more happens. If I don't try to read from the InputStream, the program hangs when it comes to proc.waitFor(); - The DOS prompt waits for an input from the keyboard. I can't achieve this by using a batch file either. Anyone knows how to do this?

1. Buffered reader/writer might not be so good an idea; use the constructor with boolean flush.
2. It might be, that you need to read from the MSDOS program's STDERR, the "error" InputStream. This can be tested in MSDOS by appending to the command-line (NT/2000) greater-than-out.txt and 2-greater-than-err.txt.

Similar Messages

  • I am having problems interacting with Microsoft Office programs since the last update:cannot create a pdf through the 'print' menu in exel and both Word and Exel docs sent in Mac Mail end up being received as .dat files.

    I am having problems interacting with Microsoft Office programs since the last update:cannot create a pdf through the 'print' menu in exel and both Word and Exel docs sent in Mac Mail end up being received as .dat files.
    Both these situations have cropped up on my MacBook Pro since the last update.
    Thanks for your help.
    Cheers
    Bob

    The 'Winmail.dat' problem has been extensively covered in these forums, I would search for that (a Google search works well) and unfortunately I have not seen the pdf print problem before, but assuming the software is current and functions normally (other than the pdf print problem) I have no suggestion other than the obvious (but time consuming) re-installation of Office.
    I wish I had more

  • User interaction with jdeveloper

    Hi, I am new to jdeveloper and have a couple of relatively simple programs up and running on it. Other than from the command line is there a way a user can interact with a basic program where the program prompts the user for input. I have used Jbuilder before and with JBuilder once you run your program the user can input required details in the debug window

    Hi Joe,
    Before you start running (or debugging, profiling, or code-coaching), you need to check a box in the project settings dialog. In the Project Settings dialog, select Runner - Options on the left and then check the "Allow Program Input" check box (at the bottom of the panel).
    When you start running (etc), the log window will contain a text field labeled "Input:" where you can enter program input (it's at the bottom of the log window). When you enter input, press "Enter" to send the text to the running program.
    -Liz

  • A problem caused this program to stop interacting with Windows

    I try to run Photoshop.exe, but it doesn't respond. I get this error message. How to fix it? I have no idea where is a problem? I had no problems with it earlier.
    ERROR MESSAGE:
    Description:
    A problem caused this program to stop interacting with Windows.
    Problem signature:
    Problem Event Name: AppHangB1
    Application Name: Photoshop.exe
    Application Version: 8.0.0.0
    Application Timestamp: 3fce5708
    Hang Signature: 1875
    Hang Type: 0
    OS Version: 6.0.6001.2.1.0.256.1
    Locale ID: 1063
    Additional Hang Signature 1: 3732c99c21cdca196fbfee3cc7094b85
    Additional Hang Signature 2: 848c
    Additional Hang Signature 3: 5c7261f725b6a443e8327138a3fe0208
    Additional Hang Signature 4: 1875
    Additional Hang Signature 5: 3732c99c21cdca196fbfee3cc7094b85
    Additional Hang Signature 6: 848c
    Additional Hang Signature 7: 5c7261f725b6a443e8327138a3fe0208
    Read our privacy statement:
    http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409

    I suspect a RAM or hardware problem.

  • Description: A problem caused this program to stop interacting with Windows. Problem signature: Problem Event Name: AppHangB1 Application Name: firefox.exe Application Version: 1.9.2.3855 Application Timestamp: 4c48d5ce Hang Signature: 9962

    I am having this problem, in the first window when I try to do anything.
    Description:
    A problem caused this program to stop interacting with Windows.
    Problem signature:
    Problem Event Name: AppHangB1
    Application Name: firefox.exe
    Application Version: 1.9.2.3855
    Application Timestamp: 4c48d5ce
    Hang Signature: 9962
    Hang Type: 0
    OS Version: 6.0.6002.2.2.0.768.3
    Locale ID: 1033
    Additional Hang Signature 1: 5df72ce88195c0212c542e9c8c172716
    Additional Hang Signature 2: 2b94
    Additional Hang Signature 3: 9acafbb8ad01bf9d2eb258d8fddad3ca
    Additional Hang Signature 4: 9962
    Additional Hang Signature 5: 5df72ce88195c0212c542e9c8c172716
    Additional Hang Signature 6: 2b94
    Additional Hang Signature 7: 9acafbb8ad01bf9d2eb258d8fddad3ca
    == This happened ==
    Every time Firefox opened
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

    I suspect a RAM or hardware problem.

  • Using Runtime.getRuntime().exec(DOS Program) with Windows 2000.

    I am trying to spawn a DOS Program from within Java.
    On Win95/98/ME, I use
    Process     p = Runtime.getRuntime().exec("START /w command.com con /c myDOSProgram.exe");
    This works on these platforms. On Win 2000, I use
    Process     p = Runtime.getRuntime().exec("START /w cmd.exe con /c myDOSProgram.exe");
    It does not work at all.
    I have tried all combinations of using START, cmd.exe, con /c, etc.
    I can spawn a Windows App using
    Process     p = Runtime.getRuntime().exec("windows.exe");
    And it works fine.
    What does it take to spawn a DOS program from Java on the Windows 2000 op sys?

    Hi. I recently wrote a java GUI that calls a DOS program with mixed success. Here's the code I used to make the call:String osName = System.getProperty("os.name" );
    String[] cmd = new String[4];
    if( osName.equals( "Windows 2000" ) || osName.equals( "Windows NT" ) )
         cmd[0] = "cmd.exe";
         cmd[1] = "/C" ;
         cmd[2] = "VBDoc.exe";
         cmd[3] = fileName;
    else if( osName.equals( "Windows 95" ) || osName.equals( "Windows 98" ) )
         cmd[0] = "command.com" ;
         cmd[1] = "/C" ;
         cmd[2] = "VBDoc.exe";
         cmd[3] = fileName;
    else
         System.out.println(osName);
    Process proc = runtime.exec(cmd);Check out this article, it gives a good explanation of how to use the exec() call:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Hope this helps!

  • The program shany ip surrvilance Playback.exe version 4.0.7.3 stopped interacting with Windows and was closed

    in windows server 2008 r2 running shany ip surveillance
    when i want to playback from record file windows encounter error:The program shany ip surrvilance Playback.exe version 4.0.7.3 stopped interacting with
    Windows and was closed

    Hi Koosha,
    You should ask this question on
    Windows Forums.
    Thanks!
    If this answers your question please mark as answer. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • A problem caused this program to stop interacting with Windows.  Problem signature:   Problem Event Name:     AppHangB1

    I have received the following error message with Adobe Acrobat Pro XI when working with Portfolio Files. I am operating Windows 7 Professional.
    Has anyone found a fix for this issue?
    Description:
      A problem caused this program to stop interacting with Windows.
    Problem signature:
      Problem Event Name: AppHangB1
      Application Name: Acrobat.exe
      Application Version: 11.0.10.32
      Application Timestamp: 547e97af
      Hang Signature: 8dc7
      Hang Type: 0
      OS Version: 6.1.7601.2.1.0.256.48
      Locale ID: 1033
      Additional Hang Signature 1: 8dc7ed9d7ff41b8cc5ee35b7294b45e9
      Additional Hang Signature 2: e6d0
      Additional Hang Signature 3: e6d001594873a6b1363ccd82616a4edf
      Additional Hang Signature 4: 8dc7
      Additional Hang Signature 5: 8dc7ed9d7ff41b8cc5ee35b7294b45e9
      Additional Hang Signature 6: e6d0
      Additional Hang Signature 7: e6d001594873a6b1363ccd82616a4edf
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt
    Please help
    John Sorkin [email protected]

    jamodi
    What computer operating system is your Premiere Elements 12 installed?
    How far into the opening of the program do you get? Do you get to the Expert or Quick workspaces?
    And, if so, how long can you stay there? What are you doing when you get this message, opening a new project
    or opening an existing one that has been saved/closed or just trying to launch the program from the desktop icon.
    Are you running the program Run As Administrator and from a User Account with Administrative Privileges?
    Do you have the McAfee antivirus program? Do you have the latest version of QuickTime installed on your computer
    with Premiere Elements 12?
    What video card/graphics card does your computer use? Have you verified at the web site of the manufacturer of the
    card that the video card/graphics card driver is up to date?
    If you do not know, check the Device Manager/Display
    Adapters to determine if you have 1 or 2 cards.
    Depending on your answers, the next step will be
    Uninstall the program the usual Control Panel way.
    (If you can get into the program long enough to go to Help Menu/Sign Out, please do that to deactivate the program
    before going to the uninstall in Control Panel area.)
    Do a run through with ccleaner (both the regular cleaner and registry cleaner parts) to get rid of leftovers from
    incomplete uninstalls and reinstalls.
    https://www.piriform.com/ccleaner
    Reinstall the program with the antivirus and firewalls disabled.
    (If you have McAfee as the antivirus, that may be problem, and we can take care of that without having to go
    through this uninstall/ccleaner/reinstall.)
    Let us start here and then decide what next.
    Thank you.
    ATR

  • I keep having this problem " A problem caused this program to stop interacting with Windows., Problem Event Name: AppHangB1". Even I uninstall or reinstall, the problem still persists! Anyone can help!?

    Description:
    A problem caused this program to stop interacting with Windows.
    Problem signature:
    Problem Event Name: AppHangB1
    Application Name: firefox.exe
    Application Version: 1.9.2.3951
    Application Timestamp: 4cc7ae16
    Hang Signature: baf1
    Hang Type: 0
    OS Version: 6.0.6002.2.2.0.256.6
    Locale ID: 18441
    Additional Hang Signature 1: 897ae6b831cea2d1f02b14199c9f3e81
    Additional Hang Signature 2: 6fd0
    Additional Hang Signature 3: b3b3b2452eec1eff2c85f2da7046f02c
    Additional Hang Signature 4: baf1
    Additional Hang Signature 5: 897ae6b831cea2d1f02b14199c9f3e81
    Additional Hang Signature 6: 6fd0
    Additional Hang Signature 7: b3b3b2452eec1eff2c85f2da7046f02c

    I suspect a RAM or hardware problem.

  • Interacting with windows programs

    I've been programming in java for about 18 months and now I'd like write a program that interacts with windows programs but I do not know where to begin. For example, if I wanted to write a program that closed WinAmp after it played the last song on my playlist how would I go about doing something like that?

    Unless this "WinApm" thing provides for being signalled somehow, other than by a user clicking on its close button or something like that, yur up the creek dude.

  • Firefox stalls when opened, nothing will load, it says program stopped interacting with windows

    Since early 19 August I have been unable to use firefox browser. "A problem caused this program to stop interacting with Windows." Those are the exact words it says right now on firefox failed attempt to load. There are numerous Problem signatures, as it says also. I have tried uninstalling and reinstalling several times but it is not available. Is firefox unaware of the problem? I use windows Vista, and it is the 32 version, not 64. My bookmarks are there, but since it freezes and never loads, I cannot access them. I hate to use I.E. but my login cards with Norton are only compatible with firefox or Internet Explorer. Please provide a solution so I can have internet access again with the most convenient browser until it broke, which was firefox. There was a new something that was available, after it was downloaded, it broke down firefox so that the internet is not available, nor anything else since then from firefox, as it is still for nearly an entire day still crashed. I hate using I.E. and Opera does not have my bookmarks and other saved information I used to be able to have on firefox until it became incompatible with the internet, as nobody is able to access firefox anymore. When will the shutdown of firefox to lose it's interactiveness with windows be restored? Or does firefox plan on permanently being unavailable for all windows users as is now the case? I hate to lose all saved items if firefox is no longer going to function with windows.

    If, for some reason, you think [http://support.mozilla.com/en-US/kb/Safe+Mode Safe Mode] is connected w/ Windows Safe Mode, it is not. [http://support.mozilla.com/en-US/kb/Safe+Mode Safe Mode] is a Firefox feature. Just a suggestion that might work...

  • Interact with asterisk , via asterisk or sip programming

    Hello there , sun people,
    I donno if this is the right forum to put my Q, if not please tell where to put it
    we have TrixBox , asterisk PBX, and we need the application to interact with it, to initiate a call, to be able to receive a call, and to register a user, in other word to function similar to a soft phone ,
    I have read about the asterisk -java and the manager API, but not sure that the mentioned functionality all could be implemented with it,
    other solution is to program everything with SIP, and to implement the functionality myself,
    I need a help to know where to start correctly with the application,
    please let me know if you need any more explanation
    Thanks in advance

    Hello there , sun people,
    I donno if this is the right forum to put my Q, if not please tell where to put it
    we have TrixBox , asterisk PBX, and we need the application to interact with it, to initiate a call, to be able to receive a call, and to register a user, in other word to function similar to a soft phone ,
    I have read about the asterisk -java and the manager API, but not sure that the mentioned functionality all could be implemented with it,
    other solution is to program everything with SIP, and to implement the functionality myself,
    I need a help to know where to start correctly with the application,
    please let me know if you need any more explanation
    Thanks in advance

  • Itunes wont open; A problem caused this program to stop interacting with Windows. Problem Event Name:     AppTermFailureEvent

    Itunes wont open: has a fault :
    Itunes will not interact with Windows?? problem called App Term failure ?
    Anyone got an idea on how to get itunes open?
    Regards

    I suspect a RAM or hardware problem.

  • NEED HELP:reading output from ms-dos program (with exec)

    I'm trying to execute an ms-dos program using exec,
    and reading it's output.
    the program is running ,but, I can't see it's output.
    I've tried many variations of this code:
    Process p = Runtime.getRuntime().exec("file_name");
    try { p.waitFor();}
    catch(Exception e) {}
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while((line = input.readLine()) != null )
    please help mewith this - thanks, froy
    System.out.println(line);
    System.out.println(p.exitValue());

    try { p.waitFor();}This doesn't return until the exec process has finished running. So there is no stream for it to get anything from.

  • Display and interact with a vi front panel on remote C++ app

    Hello:
    I am new to LV and need a little advice.  I need to display a LabVIEW VI front panel in my C++ .Net application that users can interact with to view real-time spectrum data.  The C++ app (client) must reside on a separate computer(s) from the VI so that the client can connect from anywhere around the world and interact with the VI. 
    I am not sure about the basic architecture that should accompany a good solution.  We want to use TCP/IP but not DataSocket.  I do not have access to Measurement Studio but I do have access to LabVIEW Professional Development System v 8.2.  Can anyone provide suggestions on what I need to do in order to
    1.  Connect to my TCP server using my C++ client app - I have already written TCP client and server code which communicate but now I need to integrate LV
    2.  Get access to the VI sitting on that server
    3.  Send the VI front panel to the client for display
    4.  Allow the user to modify parameters on the front panel displayed on the C++ client, send those changes back to the server, and refresh the front panel displayed in the C++ client given the new parameters (I would like a real-time display of the spectrum to always be available)
    Is this possible?  Has anyone done this using C++ .NET in VS2005?  Are there examples I can mimic or references that will help direct me?  I have searched and searched through NI's help and found a lot of good stuff but I'm still feeling confused about the best way to utilize LV.
    Thank you in advance!

    One more question ... what if I could use Measurement Studio?  The documentation seems to indicate that it's easy to create network applications and therefore it would be easy for me to re-create our VI's front panel using Measurement Studio components in my C++ app and then simply connect those components to the networked hardware (TCP/IP or DataSocket) that could be located anywhere in the world.
    Depending on what components you are using in your LabVIEW panel, it is probably pretty easy to build a Measurment Studio application to look like a LV panel.
    Given that, you could use network shared variables to move data across the network, no TCP programming necessary -- I think that this is pretty easy to do, but I don't know the specifics about variable programming in that environment.  Also, you will probably need to add some smarts to the server side to make sure that it is reading to and writing from variables in an appropriate manner.
    Question: why can't you just use LabVIEW for the client application also?

Maybe you are looking for

  • How to schedule a job in another system.

    Hi, Now i have an ABAP program, which run in system ABC, client 001. i want to schedule a job in the program, with the function modules JOB_OPEN, JOB_SUBMIT, and JOB_CLOSE. But this job should run in ABC/002. How to write code? Who can help me on the

  • Can I convert an iPhoto hardback book to a paperback book for a new order?

    I've just ordered a hardback book through iPhoto. I'd like to now order a paperback version of the same book but can't work out how to do this. I can duplicate my book, but I can't find a way of changing it to paperback. Is this possible?

  • Problems downloading iTunes 7.0

    I tried to install 7.0, but it doesn't seem to do anything. I downloaded it and when I double click on the icon to install it, nothing happens. It gave me some security warning one time, but I'm not sure if I need to turn something off to get this do

  • Variable Offset for Fiscal Year Not Working

    Hello, My fiscal year variable offsets are not working. I have an input-ready query setup with 3 restricted key figures. 1) Restricted by FY Variable 0P_FYEAR, 0VTYPE = 20, KF = 0QUANTITY 2) Restricted by FY Variable 0P_FYEAR (variable offset -1), 0V

  • Data collection task execution in UCMON

    Dear Friends I am using flexible upload method and load from data streams for data upload. Both methods are assigned to my data collection method which in turn is assigned to the task. When i execute the data collection task in consolidation monitor