回复 1# jshuanya - @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=1-2 delims==" %%a in ('wmic MemoryChip get Capacity^,Speed /value ^| findstr "="') do (
- if "%%a" == "Capacity" (
- for %%c in (%%b) do (
- set "MemCap=%%c"
- )
- for /f %%i in ('powershell "!MemCap!/(1024*1024*1024)"') do (
- set "MemCap=%%i"
- )
- set mem=!mem! 容量!MemCap!GB
- ) else if "%%a" == "Speed" (
- for %%c in (%%b) do (
- set "MemSpd=%%c"
- )
- set mem=!mem!,频率!MemSpd!
- )
- )
- echo %mem%
- pause
复制代码
|