I have this code:
if "%2"=="32" (
set bit=This is 32bit
)
if "%2"=="64" (
set bit=This is 64bit
)
echo %bit%
)
When I tried using sample.bat /s 64 the output is "This is 64bit", but when I tried using sample.bat /s 32 the output is still "This is 64bit". Then I switch it back to sample.bat 64 the ouput became "This is 32bit". I think the variable initialization is being delayed. Does someone know a workaround?