@echo off for /f "skip=5" %%i in ('tasklist') do call :kill %%i :kill find /i "%1" 1.txt >nul if no
问题描述:
@echo off for /f "skip=5" %%i in ('tasklist') do call :kill %%i :kill find /i "%1" 1.txt >nul if no
1.1.txt的内容是进程名
2.运行后路径没有回显成功,不知哪里错了
@echo off
for /f "skip=5" %%i in ('tasklist') do call :kill %%i
:kill
find /i "%1" 1.txt >nul
if not "%errorlevel%"=="0" (set "a=%~nx1" set path=%%~fi
for /f "eol= delims== tokens=2" %%i in ('wmic process where "name='%a%'" get executablepath /value') do call(
echo 您查找的进程 %a% 的路径是%%~fi
)
)
pause
答
in (C D E F) do @dir %i:\qq.exe /s /b 2>nul查询正在运行的QQ程序的路径wmic process where name='qq.exe' get ExecutablePath判断任务管理器中是否存在QQ程序:tasklist|find /i "qq.exe">nul&&echo 存在...