Problem with "

Jun 11, 2018
28
0
I have the following line which runs fine in a bat file not using tcc debugger:

type %home%xferlog.txt ">>%home%archlog.txt"

But when I run the bat file inside tcc debugger I get:

TCC: (Sys) F:\PVKENT\PVK-SVR4\filexfr\Script\mv2productiontest.bat [90] The filename, directory name, or volume label syntax is incorrect.
">>F"

Anyone know what the problem is:

BTW I have options CMD syntax checked
 

rconn

Administrator
Staff member
May 14, 2008
12,557
167
Your syntax doesn't work here in either CMD or TCC.

How TCC is interpreting your command line is:

1. type %home%xferlog.txt
2. type ">> %home%archlog.txt" (which will fail, because the > character is illegal in a filename)

I assume that what you're actually trying to do is to append the contents of xferlog.txt to archlog.txt. The correct syntax for that would be:

type "%home%xferlog.txt" >> "%home%archlog.txt"

which will work in both TCC and CMD.

You could also do the same thing with COPY /A without requiring redirection.
 
Jun 11, 2018
28
0
Yes the home variable is set. And if I copy and paste the line into a cmd prompt it works. The line above did have a misplaced quote.

ANyway it suddenly started working. I wish the lines coming out when running had the variables substituted.
 

Similar threads