Jun 7, 2018 07:30 AM
(This post was last modified: Jun 7, 2018 07:31 AM by boykanyon123.)
Hello guys,
Can someone assist me, I need to delete all the .exe files in one specific folder without deleting the subfolder into it. Preferably a 1 liner command.
Is it possible to delete that exe file even it its running? By force delete?
Thanks!
DO NOT DEAL WITH THIS MEMBER
Well you could search in the folder for ".exe", then CTRL + A, and then delete all.
Or if you really want to use batch, try
^make sure the batch file is in the folder containing the EXE files.
DEL https://ss64.com/nt/del.html
/S Delete from all Subfolders (DELTREE)
/Q Quiet mode, do not give a Yes/No Prompt before deleting.
Be Nice For Once 15hVUVz7xA4kazHdk2BuErENGCskVwjYXP
Jun 7, 2018 07:16 PM
(This post was last modified: Jun 7, 2018 07:20 PM by b00st3d.)
You don't have to do it in batch but you can do it in CMD/Powershell. Just hold Shift and right click inside the folder. In the context menu, you'll see open CMD window here or Open Powershell window here. click that and issue the cmd provided by Sir-Teabag.
Ok after testing in powershell, the command is
There's no place like ~/
How about kill all task on a specific folder ?
DO NOT DEAL WITH THIS MEMBER
(Jun 7, 2018 07:24 PM)boykanyon123 Wrote: How about kill all task on a specific folder ?
For that, you may need a little more advanced looping sequence. How many tasks are there? you might have to do them individually
(Jun 8, 2018 05:56 AM)Sir-Teabag Wrote: For that, you may need a little more advanced looping sequence. How many tasks are there? you might have to do them individually
Lets just say 2 task on a specific folder? Do i have to manual it?
DO NOT DEAL WITH THIS MEMBER
(Jun 8, 2018 09:15 AM)boykanyon123 Wrote: Lets just say 2 task on a specific folder? Do i have to manual it?
Well whatever is easier. Personally I would manually do it but you can use Batch if you want.
First, find the PID number of the programs you want to terminate, inside the control panel. (pic at bottom)
Then inside your batch file, add this
Code @echo off
taskkill /F /PID <PID number goes here>
taskkill /F /PID <Second PID number goes here>
So for example, if i wanted to end GyazoStation task, I would use
Code taskkill /F /PID 10152
. Since the number 10152 represents the task I'm wanting to kill
Hope that helps!
Jun 8, 2018 08:24 PM
(This post was last modified: Jun 8, 2018 08:24 PM by b00st3d.)
(Jun 7, 2018 09:26 AM)Sir-Teabag Wrote: Well you could search in the folder for ".exe", then CTRL + A, and then delete all.
Or if you really want to use batch, try
^make sure the batch file is in the folder containing the EXE files.
(Jun 8, 2018 01:37 PM)Sir-Teabag Wrote: Well whatever is easier. Personally I would manually do it but you can use Batch if you want.
First, find the PID number of the programs you want to terminate, inside the control panel. (pic at bottom)
Then inside your batch file, add this
Code @echo off
taskkill /F /PID <PID number goes here>
taskkill /F /PID <Second PID number goes here>
So for example, if i wanted to end GyazoStation task, I would use
Code taskkill /F /PID 10152
. Since the number 10152 represents the task I'm wanting to kill
![[Image: SnippingTool_2018-06-08_21-33-53.png]](https://net-paste.com/uploads/SnippingTool_2018-06-08_21-33-53.png)
Hope that helps!
PID changes doesn't it? If I'm correct you're going to want to terminate the process by name instead of PID. I use /f because I'm forceful...I don't know if it actually makes a difference.
Code taskkill /im processname.exe /f
There's no place like ~/
DO NOT DEAL WITH THIS MEMBER
(Jun 8, 2018 08:24 PM)b00st3d Wrote: PID changes doesn't it? If I'm correct you're going to want to terminate the process by name instead of PID. I use /f because I'm forceful...I don't know if it actually makes a difference.
Code taskkill /im processname.exe /f
Ah my bad, you're right! Sorry OP, use the process name instead of the PID, like mentioned above. 🤦♂ ✌
(Jun 7, 2018 09:26 AM)Sir-Teabag Wrote: Well you could search in the folder for ".exe", then CTRL + A, and then delete all.
Or if you really want to use batch, try
^make sure the batch file is in the folder containing the EXE files.
t y , . .
|