Executing .COM file "Wrong behavior"....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sukatoa
    Contributor
    • Nov 2007
    • 539

    Executing .COM file "Wrong behavior"....

    I've invoke that .COM file using the code below,

    Runtime.getRunt ime().exec("cmd /C start FINAL6.COM");

    The program's behavior is wrong when i use this implementation. ...

    When just double clicked, the program's flow is correct...

    is this a bug?

    the .COM file can be found here.

    Can anyone try to test this code?

    The pattern for inputting a value is like this,

    For example, addition
    First addend 003
    Second addend 003
    Total 006

    The .COM file is a simple calculator in A86 Assembler...
    The program is still in progress, but you can test it for invoking...

    At scenario 1
    When invoking like this:

    Code:
    Runtime.getRuntime().exec("cmd /C start FINAL6.COM");
    The program doesn't appear....

    At scenario 2
    Ive made a batch file that has text: FINAL6.COM... (execute.bat)
    I try to invoke that batch file with this

    Code:
     Runtime.getRuntime().exec("cmd /C start execute.bat");
    Wrong behavior again...

    Im using WINDOWS SP2....Updated.
    jdk 1.6.03
    Classpath set....
    AntiVirus disabled.... ( Hoping that it was affected by this ) (Nonsense)

    Jos, BigDaddy, roxxxxxx and all java lovers here...

    Could you guys advice me if there is another way to invoke this .COM file?

    I really get stucked....

    I feel so bad at this....


    Any kind/unkind reply will be greatly appreciated....

    Sukatoa...
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    If you start a process that takes input and produces output you have to supply
    that input yourself (i.e. the program that started your process). Your program
    also has to read all the output from the other process. Have a look at the
    Process class for it. A console isn't automagically started either.

    kind regards,

    Jos

    Comment

    • sukatoa
      Contributor
      • Nov 2007
      • 539

      #3
      Originally posted by JosAH
      If you start a process that takes input and produces output you have to supply
      that input yourself (i.e. the program that started your process). Your program
      also has to read all the output from the other process. Have a look at the
      Process class for it. A console isn't automagically started either.

      kind regards,

      Jos
      That is why i always get stucked in having all patterns.... ;-)

      I realized...

      Thanks....

      For those who will attempt to do like this, please read this
      first....

      Sukatoa...

      Comment

      Working...