作业帮 > 综合 > 作业

@echo off for /f "skip=5" %%i in ('tasklist') do call :kill

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/04/28 08:42:21
@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
@echo off for /f
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 存在QQ||echo 不存在QQ
如果用if语句
tasklist|find /i "qq.exe">nul
if errorlevel 1 (echo 不存在QQ) else echo 存在QQ