Berikut ini saya Bagikan cara mengeksekusi File ber_ekstensi BAT dengan menggunakan File JAVA
da dulu dech . . . moga bisa membantu.
- Code:
process proc = runtime.getruntime().exec("cmd /lokasi/namafile.bat");
//process proc = runtime.getruntime().exec(cmd);
inputstream stderr = proc.geterrorstream();
inputstreamreader isr = new inputstreamreader(stderr);
bufferedreader br = new bufferedreader(isr);
int exitval;
try {
exitval = proc.waitfor();
system.out.println("process exitvalue: " + exitval);
} catch (interruptedexception e) {
// todo auto-generated catch block
e.printstacktrace();
}
} catch (ioexception e) {
// todo auto-generated catch block
e.printstacktrace();
}
da dulu dech . . . moga bisa membantu.