Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import com.sun.imageio.plugins.common.InputStreamAdapter;
- public class Main {
- public static void main(String[] args) throws IOException{
- Runtime runtime = null;
- Process prc = runtime.getRuntime().exec("tasklist");
- try(BufferedReader input = new BufferedReader(new InputStreamReader(prc.getInputStream()))){
- String line;
- while((line= input.readLine())!=null){
- System.out.println(line);
- }
- runtime.getRuntime().exec("taskkill /F /T /im PaintDotNet.exe");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement