Terminating a Process from CMD: Softest to Hardest











up vote
2
down vote

favorite
1












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.










share|improve this question
























  • 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 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 at 18:55















up vote
2
down vote

favorite
1












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.










share|improve this question
























  • 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 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 at 18:55













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





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.










share|improve this question















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.







command-line batch cmd.exe wmic






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 at 17:13









Worthwelle

2,1832724




2,1832724










asked Nov 14 at 16:45









user149483

143




143












  • 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 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 at 18:55


















  • 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 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 at 18:55
















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 at 18:50




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 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 at 18:55




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 at 18:55















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375385%2fterminating-a-process-from-cmd-softest-to-hardest%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375385%2fterminating-a-process-from-cmd-softest-to-hardest%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Сан-Квентин

8-я гвардейская общевойсковая армия

Алькесар