Using set for numeric value (batch)
===

I am attempting to write a batch program that will monitor cpu usage and stop a virus scan if cpu usage is high.  It will then restart the scan when cpu usage drops.

    ECHO Checks if the total CPU usage is greater than 10%

    SET scanEnd=0

    tasklist /FI "IMAGENAME eq scan32.exe" 2>NUL | find /I /N "scan32.exe">NUL
    IF "%ERRORLEVEL%"=="0" (
    ECHO Program is running

    wmic cpu get loadpercentage /value
    FOR /f "tokens=2-3 delims==" %%b in ('wmic cpu get loadpercentage /value') do (
    echo %%b >> tempfile.txt
    echo removed %%a)

    SET /a load < tempfile.txt
    DEL tempfile.txt
    ECHO Load is "%load%"

    IF load GEQ 10 (
    ECHO High cpu usage
    TSKILL scan32
    SET scanEnd=1
    ))
    PAUSE

    IF "1" == "%scanEnd%" (
    ECHO Scan not finished
    IF load LSS 10 (
    ECHO Restarting scan
    "C:\Program Files\McAfee\VirusScan Enterprise\scan32.exe"
    SET scanEnd=0))
    ECHO End of program
    PAUSE

wmic returns the cpu usage in the form LoadPercentage=0 (or other number).  I filter this with the for loop and assign the digit to load.  For reasons I do not understand, there is something wrong with the assignment.  I am unable to echo the value (displays "") and no matter how I define high cpu usage, load passes the IF GEQ statement.  Even a 0% load is apparently greater than 10.  I know the problem is with set because I checked the tempfile.txt and it is filtered correctly, but I still have no idea why it's wrong.

Thanks for any help.