if %1x==x (call ..\GetName.bat) else set name=%1
if %1x==x (call ..\GetName.bat) else (set name=%1)
...
@echo on, shows 'set name=%1' cmd NOT activated, why in either 'if' statement. 🙁
But that does NOT answer my question on how or does the if ... else ... stmt. works. Here is a large example that does NOT show any ECHO responses, why?
1 if %FCext%X == fcX ( 2echo getName.bat ok 1 3 ) else if %FCext%X == expX ( 4echo getName.bat ok 2 5 ) else if %FCext%X == exeX ( 6echo getName.bat ok 3 7 ) else ( 8 if %FCext%X == forX ( 9echo getName.bat ok 4 10 ) else ( 11 echo Wrong FileType ... must be FC, FOR, EXP, or EXE 12 echo. 13 pause 14rem exit 15 ) 16echo getName.bat ... ENDing!!!
When testing (so far) %FCext% = fc and no "getName.bat ok 1" msg is produced, why? Nor does the "getName.bat ... ENDing!!!" msg show. But it EXITs my bat file (w/o a PAUSE!) How is that possible!?!? What's wrong with my code OR PC?
I don't know if it's the _SPACE_ char before and after the comparator, but anyway, this works :
1@echo off 2echo %FCext%X 3 4if /I %FCext%X==fcX ( 5 echo getName.bat ok 1) ELSE ( if /I %FCext%X==expX ( 6 echo getName.bat ok 2) ELSE ( if /I %FCext%X==exeX ( 7 echo getName.bat ok 3) ELSE ( if /I %FCext%X==forX ( 8 echo getName.bat ok 4) ELSE echo Wrong FileType ... must be FC, FOR, EXP, or EXE)))