Fixed Executing long command lines in a batch generates file name errors

Jun 24, 2008
Siegen, Germany
Using TCC, I create batches on the fly generating e.g. scripts to backup my files. Such a script is tod.cmd which simply calls "winrar a -hp<some_pwd> <archive> <myfiles>" to archive the specified list of files. When executing tod.cmd in TCC, I receive the following error in the WinRar error window:

u:\data\201502161639_pcben.dat: Cannot open G:\webs\gatɆwda\base\programming\nim\tools.htm
! The system cannot find the path specified.

Note the striked, uppercase E (Unicode 0x246 or UTF-8 0xC9+0x86) which is always displayed in at least one file name, and which gets inserted into the erroneous file name (the path part is "gatwda" in the example above). Also note, that there are no access problems, and that the files *do* exist. The standard code page on my system is Windows 1252, the error appears independent from storing the batch file as UTF-8 or Latin-1.

This error does not appear when executing the batch file in CMD.

Addendum: As far as I recall this error appeared with 17.0


Scott Mintz
May 20, 2008
Solon, OH, USA
Your subject seems to indicate you've isolated the issue down to "long command lines." However, your example is not a long command line. What is a long command line in your real case? How long is long?
Jun 24, 2008
Siegen, Germany
@Scott: I have no indication (contrary to the title) that the error is related to "long" command lines (sorry for that), my command lines just happen to be very long (e.g. the last produced was about 4k characters long). Also, sometimes several Ɇs appear, sometimes only one. But please note:

1) The error does not appear with CMD.
2) The error did not appear before v16 (though I would not swear on that, I have to check that with an older installation).
Nov 2, 2008
You might want to see if you can disable unicode inside the batch, probably something like a "chcp 1252" inside a set-local.

Charles Dye

Super Moderator
Staff member
May 20, 2008
Albuquerque, NM
I don't know what it's supposed to to, but it refers to files, directories, and environment variables which I don't have. Can you boil it down to a few lines which demonstrate the issue?
Jun 24, 2008
Siegen, Germany
@charles: You have a point ;-)

The - newly uploaded - command file is only just the vehicle to create the errant batch file (tod.cmd) which is executed in line 37 ("call %batfile%). This batch file, if executed standalone, produces the error.
The batch contains the (no longer filtered ;-) list of files that have changed in the specified YYxxx paths - hence it wouldn't make sense to publish the generated batch file as the resulting names are local to my computer...

For you to test the file, I'd recommend to fill in the YYxxx variables, and to uncomment the call of tod.cmd and its final deletion. This should produce tod.cmd which you can inspect before calling it.


  • test.btm
    1.1 KB · Views: 101

Charles Dye

Super Moderator
Staff member
May 20, 2008
Albuquerque, NM
I can confirm a problem (A) in TCC v17 x64 (not x86), reading long command lines from (B) OEM batch files (not UTF-16), while (C) reading line-by-line from the batch file (LOADBTM ON prevents the issue). Looks like characters at 4096-byte intervals get clobbered.

Attached is a silly batch file intended to print the letter 'A' to the screen 4096 times.


  • test.btm
    239 bytes · Views: 106
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
T Selecting line from popup history without executing Support 8
R Long commands retrieved from command history have blank line when wrapped Support 20
vefatica Long file names - a few questions Support 2
Stefano Piccardi echoerr truncates long lines Support 9
Roedy WAD Minor long-standing install problems Support 6
W Copy+Paste without breaking long lines as default? Support 1
M An issue I really don't understand and is too long and detailed for this "Title" line... Support 16
vefatica @LINES, long lines, TCC disappears Support 7
Q tcc.exe crash with long command line Support 10
I TCC crashes on gosub after long command line Support 0
nickles OPTION "trims" long ColorDir directive Support 1
L Very long startup times - solved for me Support 15
L File completion window saws long paths Support 3
A TCMD takes very long to start up Support 19
Dmitry L. Kobyakov How to? How to remove the record of the old version of the Take Command? Support 5
D Can alias pass parameters to for command? Support 3
samintz How to? Search for %(command) in Help? Support 1
T VIEW only works from command line Support 14
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
T Take Command 28: Lua reports version 5.4.0 (5.4.3 expected) Support 0
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
J Take command does not start on Windows 10 Support 3
vefatica `Back quotes` - command line vs. batch file Support 5
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
Phileosophos Is there any way to open the Take Command options dialog from the command line? Support 8
Phileosophos Command-line Editing Shortkeys That Fail Support 6
fpefpe How to? free (internal) command Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
T How to? retain command history across reboot? Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
Jay Sage Bug With Flow Control and/or Command Grouping Support 2
GermanDirk How to? EVENTLOG Command with simple User Rights not functional Support 4
Jay Sage Take Command Is Too Fast! Support 4
Jay Sage Comparison of IF with Command Group and IFF Support 6
D Open Windows 10 Photos app from command line Support 11
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
U Can not get/start Take Command gui Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
S Increasing Font Point Size in Command Tabs Support 2
mfarah Fixed The DATE command produces the wrong error message. Support 1
vefatica Command name mix-up Support 3
FreezerBurnt "Missing SETLOCAL" when initializing Visual Studio Command Prompt. Support 9
E How to? Closing desktop created by DESKTOP command Support 10
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
K Take Command fox XP? Support 7
Joe Caverly Documentation Replace internal command with LIBRARY command Support 0
fpefpe How to? command echo in title line/bar Support 2

Similar threads