Hi All!

I am trying to write an Ant task capable of opening a new command window..
(for Dos or *nux).. Then I will use this to help with Jini tasks..

My first step is finding Java code to do such an ugly task!

When I try the following test:
public class Command
{
   public static void main (String [] args) throws Exception
   {
      Runtime.getRuntime( ) .exec ( new String [] {"start", "cmd"});
   }  // end main method

}  // end Command class

I get:
F:\java\tests>javac Command.java && java Command
Exception in thread "main" java.io.IOException: CreateProcess: start cmd
error=2
        at java.lang.Win32Process.create(Native Method)
        at java.lang.Win32Process.<init>(Win32Process.java:66)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Runtime.java:566)
        at java.lang.Runtime.exec(Runtime.java:491)
        at java.lang.Runtime.exec(Runtime.java:457)
        at Command.main(Command.java:5)

F:\java\tests>

Is there something that I am missing here?

Any help would be most appreciated!

Rob
:)



--
Robert Mark Bram
B.Comp.(Systems Development/Business Systems)
B.Net.Comp.(Hons)
Doctor of Philosophy Student

School of Network Computing
Faculty of Information Technology
Monash University
Peninsula Campus
McMahons Rd
Frankston, VIC 3199
AUSTRALIA

Phone:  61 3 9904 4394
Facsimile:  61 3 9904 4124
Email: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to