我需要在同一命令提示符中更新val2的值。 Val2是一个环境变量,我从vcxproj文件中使用它。 val2将包含取决于不同目标的不同值。如何在同一命令提示符中刷新/更新val2的值?
@echo OFF
cd 8909
echo start the script
readelf qcdsp28909.mbn -l | awk '{if (match($6,/0x/)){if ($1 == "LOAD" ) print strtonum($6)}}'| awk '{ sum+=$1} END {print sum/1024/1024}' > value.txt 2>&1
set /p size=<value.txt
echo %size%
for /f "tokens=1,2 delims=." %%a in ("%size%") do (
set first_part=%%a
set second_part=%%b
)
set second_part=%second_part:~0,1%
echo %second_part%
if defined second_part if %second_part% GEQ 5 (
set /a rounded=%first_part%+1
) else (
set /a rounded=%first_part%
)
echo %rounded%
set /a rounded= "%rounded% * 1024 * 1024"
echo %rounded%
call cmd /c exit /b %rounded%
set hex=%=exitcode%
echo %hex%
SetX -m val2 "%hex%"
echo %val2%
pause