Advertisement
Guest User

Untitled

a guest
May 30th, 2015
220
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.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5. import com.sun.imageio.plugins.common.InputStreamAdapter;
  6.  
  7.  
  8. public class Main {
  9.    
  10.    
  11.    
  12.     public static void main(String[] args) throws IOException{
  13.        
  14.         Runtime runtime = null;
  15.        
  16.         Process prc = runtime.getRuntime().exec("tasklist");
  17.        
  18.         try(BufferedReader input = new BufferedReader(new InputStreamReader(prc.getInputStream()))){
  19.            
  20.             String line;
  21.            
  22.             while((line= input.readLine())!=null){
  23.                 System.out.println(line);
  24.             }
  25.            
  26.             runtime.getRuntime().exec("taskkill /F /T /im PaintDotNet.exe");
  27.            
  28.            
  29.         }
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement