tekdudedude
Technical User
- Sep 29, 2007
- 79
Hello,
I need to reset the value of a variable based on an if condition. It does not seem that a set statement works within an IF clause.
Example
The above will output the value 1, i.e. as if the set statement in the IF clause did not exist.
What can you recommend?
Thanks,
TD
I need to reset the value of a variable based on an if condition. It does not seem that a set statement works within an IF clause.
Example
Code:
@echo off
set VAR=1
if "%XFER%" == "1" (
set VAR=2
)
echo %VAR%
What can you recommend?
Thanks,
TD