The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Try this...

Posted by Kishori Sharan on January 02, 2001 at 9:30 AM

Hi Girish
I tried the following Test.java to copy a file from one directory to another using a ks.bat file and it works. The content of ks.bat is
copy %1 %2
I am using JDK1.3 on Windows98.
Thanx
Kishori

////////////////Test.java

public class Test {

public static void main(String [] args) throws Exception {
String[] cmd = { "c:\\kishori\\java\\ks.bat", "c:\\kishori\\java\\abc.java", "c:\\kishori\\java\\applets\\abcxyz.java" } ;
Process p = Runtime.getRuntime().exec ( cmd ) ;
p.destroy();

}
}






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us