DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    saeed ahmed Guest

    how i run dos commands


    i wnat to know how i can run Dos commands in my java Programe
    give me a example program?

  2. #2
    saeed hassan Guest

    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?



  3. #3
    Senavaraiyan Guest

    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


  4. #4
    Steve Guest

    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".


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links