Run 2 systems command in applet, how?
I have an applet in which the following code works fine on a windows machine for a VM windows-based router I am developing:
Code :
Process f;
String cmd="tftp -i 192.168.1.101 GET router_image.exe";
try{
f=Runtime.getRuntime().exec(cmd);
}
But I also need to add a 5 second pause and then run the router_image.exe.
Using the above commands (or modifications thereto), is this possible? If so, what would need to be done.
Thanks.
Re: Run 2 systems command in applet, how?
Welcome to Java Prograaming Forums. Try to post in the correct place :) and use code tags please.
Code :
Thread.getCurrentThread().sleep(5000);
Runtime.getRunetime().exec(cmdTwo);
Regards,
Chris
Re: Run 2 systems command in applet, how?
Quote:
Originally Posted by
Freaky Chris
Welcome to Java Prograaming Forums. Try to post in the correct place :) and use code tags please.
Code :
Thread.getCurrentThread().sleep(5000);
Runtime.getRunetime().exec(cmdTwo);
Regards,
Chris
Please see next post. Thank you.
Re: Run 2 systems command in applet, how?
Here is the code in it's totality that works, minus the pause and second command:
Code :
import java.applet.*;
import java.awt.*;
import java.io.*;
public class ROUTERcmd extends Applet {
public void init() {
Process f;
String cmd = "tftp -i 192.168.1.101 GET router_image.exe";
try {
f = Runtime.getRuntime().exec(cmd);
}
catch(IOException e) {
e.printStackTrace();
}
Process s;
}
}
So I cannot figure out where to include the other commands, i.e., execute the router_image.exe after a 5 second pause.
Any help much appreciated.