Board logo

标题: 如何通过批处理取得当前系统的内存值 [打印本页]

作者: iaspec     时间: 2006-8-3 19:34    标题: 如何通过批处理取得当前系统的内存值

请各位高手赐教
作者: electronixtar     时间: 2006-8-4 11:59
XP中文
systeminfo |find "可用"
或者用vbs+WMI+cscript
作者: iaspec     时间: 2006-8-4 14:35
基本上搞定: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语法错误,或者报拒绝访问,请各位再邦我看看
作者: 3742668     时间: 2006-8-5 18:51
在提供了WMIC的系统中,VBS就显得有些多余了。
能不能用dos命令查出电脑的配置
8F第6行
作者: mobo     时间: 2006-9-18 09:51    标题: 使用WMI查看内存信息.bat

::使用WMI查看内存信息.bat :
::---by MOBO[墨伯]
WMIC PATH Win32_LogicalMemoryConfiguration get /format:htable >Memory.htm
作者: scriptor     时间: 2006-12-22 15:05    标题: Mem


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 /? .

作者: scriptor     时间: 2006-12-22 15:09    标题: Not all work!



  Quote:
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.

作者: fjcyz     时间: 2006-12-22 18:04


  Quote:
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.

说什么不好,就说鸟语.

大家怎么看啊