Wingl83 当前离线
少尉
c:\wing\a.bat复制代码
cjiabing (甲兵时代)当前离线
荣誉版主
@echo off&setlocal enabledelayedexpansion ::获取单个名称进程的PID for /f "usebackq skip=1 delims=" %%p in (`"wmic process where(name="QQ.exe") get ProcessId"`) do echo %%p ::获取单个名称进程的路径 for /f "usebackq skip=1 delims=" %%p in (`"wmic process where(name="QQ.exe") get executablepath"`) do echo %%p ::查找单个名称进程的PID for /f "tokens=*" %%i in ('tasklist') do echo %%i |findstr /i "cmd" pause复制代码
TOP
wmic process where(name="cmd.exe")复制代码
评分人数
lxzzr (庄生晓梦)当前离线
论坛巡查
SunTB 当前离线
六级士官
@echo off set file=c:\wing\a.bat wmic process get commandLine,processid >t.txt for /f "delims=" %%a in ('type t.txt^|find /i "%file%"') do set pth=%%a set pth2=%pth:""=[% for /f "tokens=2 delims=[]" %%i in ('echo "%pth2:" "=]%"') do set pth=%%i echo.%pth% del /f/q t.txt echo.&pause复制代码