Hello,
Definitely as you said. I use NT here.
And it might also depend on the JDK version,
I think. For, it here functions under JDK 1.3
while fails under 1.1.7, although the OS is the same.
As for the running of multiple commands,
here I can use such a command like
"cmd /c dir > abc.xyz && copy abc.xyz con"
. I don't know if "&&" is supported by Win98's command.com.
(As for the usage of "cmd", please refer by "help cmd". *_*)
Batch file could automatically trigger an
appropriate OS command interpreter, I think.
So your method must be the better.
In fact, as the original poster explained,
he hope to borrow the print function from DOS by
using "copy something prn". However, here
I could not make it work even by directly striking
"copy something prn" behind the DOS prompt.
I don't know why. ( Maybe it demands pure DOS ? )
Well, best regards!
----------------------------------------
Romantic Emotionalists Must Endure Ordeals.
Email1(200103): [EMAIL PROTECTED]
Email2(200011): [EMAIL PROTECTED]
Email3(199908): [EMAIL PROTECTED]
Email4(199906): [EMAIL PROTECTED]
Office: Tokyo, Japan http://www.gecapital.com
Home: Dalian, Liaoning, China (Hometown: Hunan)
----------------------------------------
-----Original Message-----
From: Aboul - Enein, Ahmed Ahmed (Ahmed) [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 6:50 PM
To: [EMAIL PROTECTED]
Subject: Re: Running dos native commands from java application...
Hello,
cmd did not work for me, I'm using win98. I could not find any file with
this name on my hard disk.
It could be dependent on the windows version, do not worry about this!
However the following worked...
Runtime rt = Runtime.getRuntime();
rt.exec("c:\\command.com /c dir > c:\\abc.txt");
Do u know how to run more than one command with one call to command.com?
Because if I called exec() for each, the JVM would create a new process for
each command.
The batch file could be an alternative if we cannot supply more than one
command to command.com.
Regards,
Ahmed Aboul-Enein
Software Engineer
Lucent Software Center in Egypt,
Wireless Network Group,
Lucent Technologies Inc.,
1 Road 204, Salah Salem Square,
Degla, Maadi 11435, Cairo, Egypt
e-mail: [EMAIL PROTECTED]
Say what you do and do what you say!
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets