2

I was wondering if anyone had experience using command line to terminate processes using taskkill and WIMC.

I was wondering if anyone knew the order of how "hard" of a close/terminate these commands are from the command that is the "softest" (least forceful) close to the command that is the "hardest" (most forceful):

My guess would be:

Least/Softest

  1. taskkill /im processname.exe
  2. wmic process where name="processname.exe" call terminate
  3. wmic process where name='processname.exe' delete
  4. taskkill /f /im processname.exe

Most/Hardest

I am trying to create a batch command file and wanted to just know the difference between these, to see which I should use.

I prefer to use a softer close, check to see if the process is still running, and then try a harder close, and then repeat this until the program is successfully closed. Any info on the difference between any of these would be helpful, especially between using terminate and delete via CMD: WMIC would be helpful, as I cannot find documentation anywhere on them.

  • Look up wmic delete verb for more information on that wmic verb, and look up the terminate method details the wmic command calls there. The delete option details are not verbose and testing looking over handles using both on my side showed no obvious differences so they appear to do the same thing for the end result but I'm not 100% certain though if one leave objects in memory once the correlated app is killed or not. – Pimp Juice IT Nov 15 '18 at 18:50
  • I have used both taskkill /f /im processname.exe & wmic process where name="processname.exe" call terminate in the past but always assumed either way forcefully kills the process.exe from memory. The only difference I ever noticed between those in the past at least on an older version of Windows 10 is that using wmic process where name="explorer.exe" call terminate that a new explorer.exe instance would start back up whereas doing the same with taskkill /f /im explorer.exe you have to start a new instance of explorer afterwards explicitly. Not sure what they means though at the moment. – Pimp Juice IT Nov 15 '18 at 18:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.