Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
JagoVB JagoVB is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 508
Rep Power: 15
JagoVB mempunyai hidup yang Normal
Default Ask: Menggunakan Runtime pada Java

Sebelum nya maaf gan kalo salah kamar.

Ane masih newbie jadi bingung mau posting dimana.



Mohon jangan di





Ane mau tanya gan, kalo di java untuk manipulasi command prompt bagaimana caranya???



Setau ane bisa make Runtime cuma nggak bisa execute semuanya gan. Ane bingung.




Quote:





public class usingCmd {

public usingCmd(){

execute();

}



public void execute(){

try{

Process p = Runtime.getRuntime().exec("notepad");

System.out.println("Executed");

}

catch(Exception e){

e.printStackTrace();

System.out.println("Cannot be Execute");

}

}



public static void main(String [] args){

new usingCmd();

}



}





Code yang di atas ane pake buat buka notepad, berhasil. cuma kalau misalnya diganti



".exec("md C:\test")"

nggak bisa gan ke execute gan.



Kira-Kira gimana ya gan supaya ane bisa ngotak-ngatik cmd lewat Java.



</div>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Terkait
Thread Thread Starter Forum Replies Last Post
[ASK] solusi runtime error pada modem booster RootSeeker Shareware & Freeware 0 24th October 2012 10:13 PM
memperbaiki c runtime library pada windows CaraCepet Shareware & Freeware 0 24th October 2012 02:14 PM
[SHARE] Sun Java SE Runtime Environment 6.0 Update 21 BagiBagi Shareware & Freeware 0 24th October 2012 01:14 PM
Java Runtime Environment 1.6.0.26 (32-bit) rizqiulilabshor Shareware & Freeware 0 22nd July 2011 05:14 PM

 


All times are GMT +7. The time now is 11:40 AM.