Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // show tasks, redirect errors to NUL (hide errors)
- exec("tasklist 2>NUL", $task_list);
- print_r($task_list);
- // kill tasks matching
- $kill_pattern = '~(helpctr|jqs|javaw?|iexplore|acrord32)\.exe~i';
- // get tasklist
- $task_list = array();
- exec("tasklist 2>NUL", $task_list);
- foreach ($task_list AS $task_line)
- {
- if (preg_match($kill_pattern, $task_line, $out))
- {
- echo "=> Detected: ".$out[1]."\n Sending term signal!\n";
- exec("taskkill /F /IM ".$out[1].".exe 2>NUL");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment