for /f "tokens=1-3 delims= " %%a in ('cscript /nologo temp.vbs') do set "size=%%a" & set "freesize=%%b" & set "usage=%%c"
set /a usage=100-!usage!
del temp.vbs 2>nul
if !usage! gtr 50 echo,盘符%%j 总空间!size!GB 剩余空间!freesize!GB 使用率!usage!%%
)
:cpu
for /f "tokens=2 delims==" %%a in ('wmic path Win32_PerfFormattedData_PerfOS_Processor get PercentProcessorTime /value^|findstr "PercentProcessorTime"') do (
set UseCPU=%%a
goto :mem
)
:mem
for /f "tokens=2 delims==" %%a in ('wmic path Win32_PhysicalMemory get * /value^|findstr "Capacity"') do (
set BBB=%%a
call :division !BBB! 1073741824 quote 2
set /a TolMem=TolMem+quote
)
for /f "tokens=2 delims==" %%a in ('wmic path Win32_PerfFormattedData_PerfOS_Memory get * /value^|findstr "AvailableBytes"') do (
set BBB=%%a
call :division !BBB! 1073741824 quote 2
set AavMem=!quote!
)
call :division !AavMem! !TolMem! quote 2