Powered by GeSHi

Source code for cpuload.bat

(view source code of cpuload.bat as plain text)

  1. @ECHO OFF
  2. :: This batch file was generated using the WMI Code Generator, Version 2.01
  3. :: http://www.robvanderwoude.com/wmigen.html
  4. :: It has been edited afterwards to show only the CPU load percentage
  5.  
  6. IF "%~1"=="" (
  7. 	SET Node=%ComputerName%
  8. ) ELSE (
  9. 	SET Node=%~1
  10. )
  11.  
  12. FOR /F "tokens=2 delims==" %%A IN ('WMIC.EXE /Node:%Node% /Output:STDOUT Path Win32_Processor Get LoadPercentage /Format:LIST') DO SET CPULoad=%%A
  13.  
  14. SET CPULoad
  15.