如何使用Windows cmd获取总物理内存 [英] How can I get total physical memory using Windows cmd

查看:811
本文介绍了如何使用Windows cmd获取总物理内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查询了typeperf计数器和实例,但找不到有关总内存的任何信息.我只发现

I inquired typeperf counters and instances, but couldn't find anything about the total memory. I only found

    \Memory\Availble Bytes
    \Memory\Cache Bytes
    \Process\Private Bytes
    \Process\Working Set

并添加它们的任何组合与任务管理器中的总内存不匹配.

and adding any combination of them didn't match the total memory in task manager.

我也尝试过

    systeminfo | findstr /C:"Total Physical Memory"

但这仅适用于英语模式(chcp 437).我不是美国人,也不是为各个国家/地区制作节目..最重要的是,这花费了太长时间.

but this only worked in english mode(chcp 437). I am not an American and making program for various countries.. and above all, this takes too long time.

请问,有谁知道一个好主意,只用cmd就能在Windows中获得总内存?或者,请向我解释一下内存的关系,以便我可以从typeperf查询中计算出总内存.

Please, anyone know good idea to get total memory in Windows with only cmd? Or please explain me the relation of memories so that I can calculate the total memory from typeperf queries..

推荐答案

如何获取总物理内存

使用以下命令:

How can I get total physical memory

Use the following command:

wmic ComputerSystem get TotalPhysicalMemory

示例输出:

TotalPhysicalMemory
4275273728


总物理内存

wmic ComputerSystem get TotalPhysicalMemory

可用物理内存

wmic OS get FreePhysicalMemory

虚拟内存最大大小

wmic OS get TotalVirtualMemorySize

可用虚拟内存

wmic OS get FreeVirtualMemory


您可以将它们如下组合为一个命令:


You can combine them as follows into one command:

wmic ComputerSystem get TotalPhysicalMemory && wmic OS get FreePhysicalMemory,TotalVirtualMemorySize,FreeVirtualMemory

来源 SuperUser 回答"Windows 7中的Wmic记忆"? 8088

这篇关于如何使用Windows cmd获取总物理内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆