how i run dos commands


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: how i run dos commands

Hybrid View

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


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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center