Wmic获取Windows硬件资源信息

 一、内存、磁盘、CPU

1、总物理内存(KB):wmic os get TotalVisibleMemorySize

2、空闲物理内存(KB):wmic os get FreePhysicalMemory

3、总虚拟内存(KB):wmic os get SizeStoredInPagingFiles

4、空闲虚拟内存(KB):wmic os get FreeSpaceInPagingFiles

 

5、磁盘空间:wmic diskdrive get size

6、剩余磁盘空间:wmic volume get Caption,freespace

7、CPU使用率:wmic cpu get DeviceID,loadpercentage

 

 

二、Windows开启winrm服务

winrm quickconfig
winrm e winrm/config/listener
winrm set winrm/config/service/auth @{Basic="true"}
winrm set winrm/config/service @{AllowUnencrypted="true"}
winrm get winrm/config

 

posted @ 2021-10-16 12:53  TianShu  Views(614)  Comments(0Edit  收藏  举报