- @echo off
- :1
- @del 123.txt /q
- for /f "skip=2 tokens=3 delims=," %%i in ('wmic process where name^="cmd.exe" get commandline^,ProcessID /format:csv^|findstr /vi "%~nx0"') do echo %%i >>123.txt
- @echo off
- for /f "delims=" %%i in (%cd%\123.txt)do set n=%%i
- echo %n%
- taskkill /pid %n%
- if exist %cd%\123.txt goto 1
- pause
复制代码 鉴于大家的意见,我写了这代码。执行起来还可以 |