0

Why c is 8 outside the if but is 0 after the same operation inside it? I'm using an ENABLEDELAYEDEXPANSION AT THE TOP. Am I missing something?

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set a=5
set b=3

SET c=0
set /a c=5+3
echo. %a% %b% %c%

SET c=0
IF 2 GTR 0 (
set /a c=5+3
echo. %a% %b% %c%
)
Antoni Gual Via
  • 714
  • 1
  • 6
  • 14

0 Answers0