-
how i run dos commands
i wnat to know how i can run Dos commands in my java Programe
give me a example program?
-
Re: how i run dos commands
"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?
-
Re: how i run dos commands
"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
-
Re: how i run dos commands
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".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks