i wnat to know how i can run Dos commands in my java Programe
give me a example program?
Printable View
i wnat to know how i can run Dos commands in my java Programe
give me a example program?
"saeed ahmed" <saeedhassan786@hotmail.com> wrote:
>
i want to know how i can run Dos commands in my java Programe
>give me a example program?
"saeed ahmed" <saeedhassan786@hotmail.com> wrote:
>
>i wnat to know how i can run Dos commands in my java Programe
>give me a example program?
Hai
Use the Runtime class of Java
Just try this code
import java.io.*;
public class RunTime
{
public static void main(String args[])
{
try
{
Process theProcess = Runtime.getRuntime().exec("NotePad");
}
catch(Exception e){e.printStackTrace();}
}
// end class
}
Think this will help to sort ur problem
Regards
Sena
saeed hassan wrote:
> "saeed ahmed" <saeedhassan786@hotmail.com> wrote:
>
> i want to know how i can run Dos commands in my java Programe
>
>>give me a example program?
>>
>
See java.lang.Runtime.exec(). Also see Michael Daconta's article on Java
World (www.javaworld.com) on "When "Runtime.exec() won't".