IF difficulty

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 21, 2008
4
0
#1
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??

Thanks,

Tom
 

rconn

Administrator
Staff member
May 14, 2008
10,160
86
#2
COPY /U difficulty

> TCC/LE seems to be behaving as if the IF command applies to everything
> after it and not just to the SET.
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.)

Rex Conn
JP Software
 
May 21, 2008
4
0
#3
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 ...

--
Tom