本帖最后由 ANSL 于 2022-11-25 12:50 编辑
- @echo off
- setlocal enabledelayedexpansion
- call :Scan
- echo %bet%
- pause
-
-
-
- :Scan
- echo 开始扫描....
- set k=1024000
- set low=100
- set hig=2048
- for /f %%a in ('wmic os get FreePhysicalMemory^|findstr "[0-9]"') do set A=%%a
- for /f %%a in ('wmic os get TotalVisibleMemorySize^|findstr "[0-9]"') do set B=%%a
- set/a c=%b%-%a%
- set/a c=%b%/%c%
- if %b% leq %low% set ls=K&set/a b=%b%*%k%&set/a a=%a%*%k%&goto :ls
- if %b% gtr %hig% set ls=G&set/a b=%b%/%k%&set/a a=%a%/%k%&goto :ls
- set ls=M
- :ls
- set d=正在使用的内存:%%%c%
- set f=总内存:%b%
- set g=可用内存:%a%
- set "bet=%d%_%f% !ls!B_%g% !ls!B"
- goto:eof
复制代码 不全都是自己写的
看了 @小牛 发的帖 和 @qixiaobin0715 的完美回复
存为ANSI格式 |