When you double-click Run, enter the name of the process
Batch code:
Copy Code code as follows:
@ echo off
Color 6e
del 1.txt
del ildd.txt
TASKLIST &G T;>ildd.txt
title kills the process and deletes the source file--by:qp
CLS
Echo.
Echo Current process:
for/f "Skip=3"%%i in (' findstr. * "Ildd.txt") do echo%%i
Echo. Enter the name of the process to end and remove
Echo: 1.exe Ping.exe rar.exe
set/p command= Input:
WMIC process get executablepath,handle|find/i "%command%" >> 1.txt
CLS
for/l%%d in (1 1 4) do echo.
echo the process you entered is:%command%
for/f "Tokens=1 delims=."%%i in (' Type 1.txt ') do (
Echo found path with:%%i.exe & Set "Path =%%i"
)
Echo.
Echo presses any key to end the process and delete the file
Pause>nul
Echo.
Echo Resolute to delete press any key ...
for/l%%d in (1 1 4) do echo.
Pause>nul
taskkill/f/im%command%
del/f "% path%.exe"
if not exist "% path%.exe" Echo succeeded: File deleted ...
del 1.txt
del ildd.txt
Echo Press any key to end this program
Pause>nul