By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,201 Members | 1,617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,201 IT Pros & Developers. It's quick & easy.

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

100+
P: 539
I've invoke that .COM file using the code below,

Runtime.getRuntime().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:

Expand|Select|Wrap|Line Numbers
  1. 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

Expand|Select|Wrap|Line Numbers
  1.  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...
Mar 14 '08 #1
Share this Question
Share on Google+
2 Replies


Expert 10K+
P: 11,448
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
Mar 14 '08 #2

100+
P: 539
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...
Mar 14 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.