中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-07-14 22:35
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 如何通过批处理取得当前系统的内存值 查看 2,407 回复 7
楼 主 如何通过批处理取得当前系统的内存值 发表于 2006-08-03 19:34 ·  IANA 局域网IP(Private-Use)
新手上路
积分 14
发帖 3
注册 2006-08-03 19:33
19年会员
UID 59791
状态 离线
请各位高手赐教
2 发表于 2006-08-04 11:59 ·  中国 四川 成都 教育网
铂金会员
★★★★
积分 7,493
发帖 2,672
注册 2005-09-02 00:00
20年会员
UID 42173
性别 男
状态 离线
XP中文


systeminfo |find "可用"


或者用vbs+WMI+cscript

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
3 发表于 2006-08-04 14:35 ·  IANA 局域网IP(Private-Use)
新手上路
积分 14
发帖 3
注册 2006-08-03 19:33
19年会员
UID 59791
状态 离线
基本上搞定:vbs+wmi。
之所以做系统内存判断,是要更改boot.ini的参数,超过某值范围,增加pae参数,不超过某值,则不加参数
使用systeminfo对WINDOWS系统无通用性
VB脚本:aa.vbs
strComputer = "localhost"
Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")

For Each wbemObject In wbemObjectSet
WScript.Echo "Total Physical Memory (kb): " & wbemObject.TotalPhysicalMemory
Next

在批处理直接调用:
for /f "tokens=5" %%i in ('"cscript //nologo aa.vbs"') do set sysmem=%%i
if %sysmem% lss 523184 (
findstr /V "C:" \boot.ini>\TMP.TXT
attrib -s -h \boot.ini
move /y \TMP.TXT \boot.ini
attrib +s +h \boot.ini
) else (
for /f "delims=" %%l in (\boot.ini) do (
echo.%%l | find/i "/fastdetect">nul && echo %%l /pae||echo %%l
findstr /V "C:" %%l
)>>\b1.txt
attrib -s -h \boot.ini
move /y \b1.txt \boot.ini
attrib +s +h \boot.ini
)
但现在有个问题,IF判断它老是报错,说ELSE语法错误,或者报拒绝访问,请各位再邦我看看
4 发表于 2006-08-05 18:51 ·  中国 湖北 荆门 电信
荣誉版主
★★★
积分 2,013
发帖 718
注册 2006-02-18 07:07
20年会员
UID 50550
状态 离线
在提供了WMIC的系统中,VBS就显得有些多余了。
能不能用dos命令查出电脑的配置
8F第6行
5 使用WMI查看内存信息.bat 发表于 2006-09-18 09:51 ·  新加坡 腾讯云
初级用户
积分 73
发帖 30
注册 2006-09-18 08:35
19年会员
UID 62944
状态 离线
::使用WMI查看内存信息.bat :
::---by MOBO[墨伯]
WMIC PATH Win32_LogicalMemoryConfiguration get /format:htable >Memory.htm
6 Mem 发表于 2006-12-22 15:05 ·  中国 北京 中国科学院研究生院
银牌会员
★★★
积分 1,187
发帖 555
注册 2006-12-21 07:35
19年会员
UID 74129
性别 男
状态 离线

Using Mem>

Mem / c <enter>

then it return a detail memory which are used and free.

For more infomation about the usage of mem, just typing

mem /? .
7 Not all work! 发表于 2006-12-22 15:09 ·  中国 北京 中国科学院研究生院
银牌会员
★★★
积分 1,187
发帖 555
注册 2006-12-21 07:35
19年会员
UID 74129
性别 男
状态 离线
Originally posted by electronixtar at 2006-8-3 22:59:
XP中文


systeminfo |find "可用"


或者用vbs+WMI+cscript



Sysyeminfo doesn't work at XP Home Version!

so, I suggest you using mem.exe and combining other paraments to meet you.
8 发表于 2006-12-22 18:04 ·  中国 福建 厦门 电信
初级用户
积分 68
发帖 36
注册 2006-12-20 15:31
19年会员
UID 74057
性别 男
状态 离线
Originally posted by scriptor at 2006-12-22 02:09 AM:



Sysyeminfo doesn't work at XP Home Version!

so, I suggest you using mem.exe and combining other paraments to meet you.



说什么不好,就说鸟语.

大家怎么看啊
论坛跳转: