Terminating a Process from CMD: Softest to Hardest
up vote
2
down vote
favorite
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
taskkill /im processname.exe
wmic process where name="processname.exe" call terminate
wmic process where name='processname.exe' delete
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
add a comment |
up vote
2
down vote
favorite
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
taskkill /im processname.exe
wmic process where name="processname.exe" call terminate
wmic process where name='processname.exe' delete
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
Look up wmicdelete
verb for more information on that wmic verb, and look up theterminate
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 bothtaskkill /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 usingwmic process where name="explorer.exe" call terminate
that a new explorer.exe instance would start back up whereas doing the same withtaskkill /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
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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
taskkill /im processname.exe
wmic process where name="processname.exe" call terminate
wmic process where name='processname.exe' delete
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
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
taskkill /im processname.exe
wmic process where name="processname.exe" call terminate
wmic process where name='processname.exe' delete
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
command-line batch cmd.exe wmic
edited Nov 14 at 17:13
Worthwelle
2,1832724
2,1832724
asked Nov 14 at 16:45
user149483
143
143
Look up wmicdelete
verb for more information on that wmic verb, and look up theterminate
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 bothtaskkill /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 usingwmic process where name="explorer.exe" call terminate
that a new explorer.exe instance would start back up whereas doing the same withtaskkill /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
add a comment |
Look up wmicdelete
verb for more information on that wmic verb, and look up theterminate
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 bothtaskkill /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 usingwmic process where name="explorer.exe" call terminate
that a new explorer.exe instance would start back up whereas doing the same withtaskkill /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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Look up wmic
delete
verb for more information on that wmic verb, and look up theterminate
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 usingwmic process where name="explorer.exe" call terminate
that a new explorer.exe instance would start back up whereas doing the same withtaskkill /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