Pages

Wednesday, November 27, 2013

To Kill the process to avoid the system slow in Java

 public static void killProcessingExe( String processName)
   {
 try
 {

    final String KILL = "taskkill /IM ";
    Runtime.getRuntime().exec(KILL + processName);
    setLog("Info","Killed the IE.exe");
    Thread.sleep(3000); //Allow OS to kill the process
 }
 catch (Exception e) {
// TODO: handle exception
 setLog("Error",e.toString());
}

   }

No comments:

Post a Comment