站长资源脚本专栏

批处理实现的结束进程并删除文件的代码

整理:jimmy2025/1/6浏览2
简介复制代码 代码如下:@echo off title=结束进程并删除文件[Null] echo.请输入进程名: set /p exe= For /f "tokens=2,3 delims=," %%i In ('wmic process get ProcessId^,ExecutablePath /f
复制代码 代码如下:
@echo off
title=结束进程并删除文件[Null]
echo.请输入进程名:
set /p exe=
For /f "tokens=2,3 delims=," %%i In ('wmic process get ProcessId^,ExecutablePath

/format:csv^|find /i "%exe%"') do (
taskkill /im %exe%
del "%%i" /q
)
pause>nul