cmd - 'Missing operator' in batch for statement -
i getting 3 missing operator. lines output following batch script
set w3wp2id=0 set w3wp1id=0 set w3wpid=0 set valuesareset=false /f "tokens=2,3,4 delims=," %%a in ('typeperf -sc 1 -y "\process(w3wp*)\id process" ^| find /v "\\" ^| find /v "please wait..."') ( if "%valuesareset%"=="false" ( set /a w3wp2id=%%~a+0 set /a w3wp1id=%%~b+0 set /a w3wpid=%%~c+0 ) set valuesareset=true ) at first thought output coming 3 set statements in forloop, upon investigation no longer think issue. leading me believe has for statement itself, cannot figure out wrong.
i need suppress these warnings since output of script logged.
any appreciated, thanks, t.
edit: should add 3 variables getting correct values set.
if want values before decimal point use %~ni expansion method treat numbers after decimal point extension removing them. (technically rounding down).
set "valuesareset=false" /f "tokens=2-4 delims=," %%a in ( 'typeperf -sc 1 -y "\process(w3wp*)\id process" ^| find /v "\\" ^| find /v "please wait..."' ) if "%valuesareset%"=="false" (set "w3wp2id=%%~na" set "w3wp1id=%%~nb" set "w3wpid=%%~nc" set "valuesareset=true" )
Comments
Post a Comment