2楼 terse
http://www.bathome.net/redirect. ... 2&fromuid=53540- @echo off&setlocal enabledelayedexpansion
- set "wmi=LastBootUpTime,LocalDateTime,TotalVisibleMemorySize,FreePhysicalMemory"
- for /f "delims=U" %%a in ('cmd /u /c echo 唉') do set "tab=%%a"
- (
- for /f "skip=1 tokens=1-4" %%i in ('"wmic os get %wmi%"') do for %%j in (%%j) do (
- set "ymd=%%j"
- set /a "m=(1!ymd:~4,2!+5)%%12+4,y=!ymd:~,4!-m/14,d=1!ymd:~6,2!-100,h=1!ymd:~8,2!-100"
- set /a "s=1461*y/4+153*m/5+d"
- set /a "s1=h*3600+(1!ymd:~10,2!-100)*60+1!ymd:~12,2!-100"
- set "ymd=%%k"
- set /a "m=(1!ymd:~4,2!+5)%%12+4,y=!ymd:~,4!-m/14,d=1!ymd:~6,2!-100,h=1!ymd:~8,2!-100"
- set /a "s=(1461*y/4+153*m/5+d-s)*86400-s1,s+=h*3600+(1!ymd:~10,2!-100)*60+1!ymd:~12,2!-100"
- set size=%%l
- set /a "useb=%%l-%%i,usebp=useb*100/%%l"
- for %%a in (size useb) do (
- set mod=!%%a!
- for /l %%b in (1 1 3) do (
- set/a "Qent=mod/1048576,mod=mod%%1048576*10"
- set "%%a_g=!%%a_g!!Qent!"
- )
- )
- echo 物理内存: !size_g:~,-2!.!size_g:~-2! [GB]
- echo 已使用 : !useb_g:~,-2!.!useb_g:~-2! [GB]
- echo 使用率 : !usebp!%%
- rem echo 系统运行时间 : !s! 秒
- )
- )
- pause
复制代码