By registering with us, you'll be able to discuss, share and exchange private messages with other members of our community.

SignUp Now!

IF difficulty

Hi Rex or whomever ...

A minor annoyance here, I frequently use the following alias to update a flash drive:
set drv=k %+ if "%1" != "" set drv=%1 %+ copy /su e:\dirname\* %drv:\dirname\ %+ unset drv
In my old 4NT this works fine, it copies changed or new files to drive k: (or whatever drive I designate). In TCC/LE (12.11.74) if I leave the parameter off it does nothing, just returns to the prompt -- no errors or messages -- even when there are multiple new or changed files on drive e:. However, if I add the parameter it works fine. This is a long-standing problem, I just never took the time to investigate it before.

TCC/LE seems to be behaving as if the IF command applies to everything after it and not just to the SET.

What am I missing here??


Go to OPTION / Startup and see what your "Duplicate CMD.EXE bugs" setting is. (CMD will discard all remaining commands on the line if an IF fails; see IF in the help for details.)

Thanks, that was it. So is duplication of bugs considered a feature? :-) I guess so if you have to make batch files run in both environments ...