- 帖子
- 25
- 积分
- 33
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2010-10-21
|
[文本处理] 批处理怎样判断文本,高于这个数值或者小于这个,执行命令?
通过这个命令
tasklist /v>123.txt
得到 123.txt文本内容如下
图像名 PID 会话名 会话# 内存使用 状态 用户名 CPU 时间 窗口标题
========================= ====== ================ ======== ============ =============== ================================================== ============ ========================================================================
System Idle Process 0 Console 0 28 K Running NT AUTHORITY\SYSTEM 14:09:56 暂缺
System 4 Console 0 304 K Running NT AUTHORITY\SYSTEM 0:01:20 暂缺
smss.exe 460 Console 0 404 K Running NT AUTHORITY\SYSTEM 0:00:00 暂缺
csrss.exe 972 Console 0 8,220 K Running NT AUTHORITY\SYSTEM 0:00:45 暂缺
winlogon.exe 1012 Console 0 11,216 K Running NT AUTHORITY\SYSTEM 0:00:01 NetDDE Agent
services.exe 1056 Console 0 9,716 K Running NT AUTHORITY\SYSTEM 0:00:14 暂缺
lsass.exe 1068 Console 0 1,364 K Running NT AUTHORITY\SYSTEM 0:00:11 暂缺
svchost.exe 1244 Console 0 5,500 K Running NT AUTHORITY\SYSTEM 0:00:00 暂缺
svchost.exe 1292 Console 0 4,216 K Running NT AUTHORITY\NETWORK SERVICE 0:00:03 暂缺
svchost.exe 1324 Console 0 22,584 K Running NT AUTHORITY\SYSTEM 0:00:07 暂缺
svchost.exe 1436 Console 0 3,244 K Running NT AUTHORITY\LOCAL SERVICE 0:00:00 暂缺
spoolsv.exe 1804 Console 0 4,936 K Running NT AUTHORITY\SYSTEM 0:00:00 暂缺
acs.exe 1884 Console 0 9,896 K Running NT AUTHORITY\SYSTEM 0:00:00 暂缺
AlipaySecSvc.exe 1912 Console 0 4,776 K Running NT AUTHORITY\SYSTEM 0:00:00 暂缺
winvnc4.exe 2020 Console 0 198,068 K Running NT AUTHORITY\SYSTEM 0:00:00 winvnc::IPC_Interface
wscntfy.exe 1532 Console 0 2,624 K Running IDC-4C0559B01D7\zdq 0:00:00 暂缺
然后通过搜索提取 某exe的行,,,,第5列,,,第5列是 进程的内存使用情况 ....比如已经提取出来EXE的内存使用情况是 198,068
每次提取 进程使用情况的值,,,,然后进行判断,,, 如果某EXE内存使用情况低于100,000 或者低于11,216 就使用某DOS命令 高于100,000 或者11,216就退出,,,,
请高手们 出几个列子啊
另外再请教一个判断,,,检测指定判断当前目录的 某TXT的 KB大小,,,, 如果KB大小 小于多少KB 就执行 DOS命令 大于就退出
另外再请教一个判断,,,检测指定判断当前目录的 某TXT的 KB大小,,,, 如果KB大小 小于多少KB 就执行 DOS命令 大于就退出
另外再请教一个判断,,,检测指定判断当前目录的 某TXT的 KB大小,,,, 如果KB大小 小于多少KB 就执行 DOS命令 大于就退出 |
|