Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

O/p of a DOS CMd


  • From: Vaneeta.Hazarika@xxxxxxxxxx (Hazarika Vaneeta)
  • Subject: O/p of a DOS CMd
  • Date: Thu, 30 Nov 2000 15:00:35 +0530

Hi all,
         I want o/p of a DOS Cmd.I have written a program but it's
not working.Can anyone help.

Thanks in advance.

 import java.io.*;

 class runproc
{
 public static void main(String args[]) throws IOException
{
  Process p = Runtime.getRuntime().exec("start dir *.*");
  String line;
   try
  {
   InputStreamReader r = new InputStreamReader(p.getInputStream());
   BufferedReader b = new BufferedReader(r);
   while(( line = b.readLine()) != null)
   System.out.println(line);
   b.close();
  }
   catch(IOException e)
  {
   System.out.println(e);
  }
 }
}


---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx