@echo off for /f "tokens=2,3 delims=," %%i in ('wmic process get ProcessId^,ExecutablePath /format:csv^|find /i "程序名.exe"') do ( call set pid=%%pid%% /pid %%j set filepath=%%i ) taskkill.exe /f %PID% del /f/q "%filepath%"