{"id":218,"date":"2021-09-03T02:00:24","date_gmt":"2021-09-03T02:00:24","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/programming-a-batch-file-to-kill-a-process-12884-html"},"modified":"2021-09-03T02:57:18","modified_gmt":"2021-09-03T02:57:18","slug":"programming-a-batch-file-to-kill-a-process-12884-html","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/a-batch-file-to-kill-a-process\/12884.html","title":{"rendered":"Solved A batch file to kill a process"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>I am trying to create a batch file to kill a process only if it is running. I found a pskill tool from windows xp tool site but when I put it in the batch file and scheduled the task, a black window always flash to kill the process no matter if it is running or not. My question is:<br \/>\n1. How do I put it in the batch to run this pskill by detecting if it alive first.<br \/>\nOr&#8211;2. How do I get this scheduled task run minimized or another secretive way? I don&#8217;t want to see the black window popping up.<br \/>\nThanks a lot if you could help me! Note: I can make the batch file run minimized from its property setting but when it is in scheduled task, I couldn&#8217;t get it to minimize anymore.<\/p>\n<p>You can use the TASKKILL command with the \/FI switch that has an operator of e and a value of RUNNNING<br \/>\nIt might look something like this:<br \/>\nTASKKILL \/F \/IM notepad.exe \/FI STATUS ne RUNNING<\/p>\n<p>Type the TASKKILL \/? to see all the possible filers,operators and values.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","meta":{"inline_featured_image":false,"iawp_total_views":15},"question-category":[61],"question_tags":[],"class_list":["post-218","question","type-question","status-publish","hentry","question-category-netware"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=218"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=218"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=218"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}