- @echo off
- rem 初始化数据
- set processname=%1
- set CtpMsg[1].subid=1
- set CtpMsg[1].flag=0
- set CtpMsg[1].Size=0
- set CtpMsg[2].subid=2
- set CtpMsg[2].flag=0
- set CtpMsg[2].Size=0
- set Flag=0
- set Size=0
- set CtpNum=2
-
- rem 存储标记位
- :begin
- setlocal enabledelayedexpansion
- FOR /F "tokens=1,2,3 delims= " %%a in ('wmic process where name^="%process_name%" get CommandLine^,WorkingSetSize ^| findstr %process_name%') do (
- rem echo %%b %%c
- set /a Flag=%%b & set /a Size=%%c
- set /a CtpMsg[!Flag!].flag=!Flag!
- set /a CtpMsg[!Flag!].Size=!Size!/1024/1024
- )
-
- rem 报告对应标记相应信息
- set Flag=0
-
- for /L %%a in (1,1,%CtpNum%) do (
- if !CtpMsg[%%a].flag!==%Flag% (
- rem echo !CtpMsg[%%a].subid! stopped
- ) else (
- echo !CtpMsg[%%a].subid! running
- echo !CtpMsg[%%a].subid! !CtpMsg[%%a].Size!
- )
- )
-
- rem 复位数据
- for /L %%a in (1,1,%CtpNum%) do (
- set CtpMsg[%%a].flag=0
- )
-
- choice /t 1 /d y /n >nul
- goto begin
复制代码 添加qq进程在那个位置添加 |