批处理实现的结束进程并删除文件的代码
(编辑:jimmy 日期: 2024/12/24 浏览:3 次 )
复制代码 代码如下:
@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
@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
下一篇:批量列出所有文件名的批处理