Advertisement
Guest User

Untitled

a guest
Apr 24th, 2009
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.io.*;
  2. public class ExecTest {
  3.     public static void main(String[] args) throws IOException {
  4.         Process result = Runtime.getRuntime().exec("explorer /e=\"search-ms:query=something.jpg\"");
  5.  
  6.         BufferedReader output = new BufferedReader(new InputStreamReader(result.getInputStream()));
  7.         StringBuffer outputSB = new StringBuffer(40000);
  8.         String s = null;
  9.  
  10.         while ((s = output.readLine()) != null) {
  11.             outputSB.append(s + "\n");
  12.             System.out.println(s);
  13.         }
  14.  
  15.         String resultString = outputSB.toString();
  16.         System.out.println( resultString );
  17.     }
  18. }
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement