打开记事本
复制以下代码到记事本
@echo off
for /f "tokens=2 delims==" %%a in ('wmic path Win32_PerfFormattedData_PerfOS_Processor get PercentProcessorTime /value^|findstr "PercentProcessorTime"') do (
set UseCPU=%%a
)
echo CPU使用率:%UseCPU%%%
pause
另存为bat文件,保存类型为所有类型
双击运行即可!