Incorrect ARGV1 when using linux-style paths

Apr 7, 2010
Running version 16.03.55. I have the the option "UNIX/Linux-style paths" turned on. The problem is: when I call a batch script using forward slashes, ARGV1 is setup incorrectly. This happens even in a directory with no spaces.

>projects/test/printargs.bat applepie
ARGV0: projects/test/printargs.bat
ARGV1: /test/printargs.bat
ARGV2: applepie

Is this a bug?

Normally, a workaround would be to put the script path in quotes, but in my case, the command is being constructed and executed by a third-party utility.



Staff member
May 14, 2008
Not exactly a bug; more of a "nobody ever requested it" issue.

The UnixPaths directive was intended for external commands, not internals like batch files. So in the absence of a quoted argument, TCC is breaking the argument on the switch character.

I will add a check for this in the next version of TCC. However, I'm puzzled by your comment that "the command is being constructed and executed by a third-party utility" -- since CMD chokes on that command line (and can't even find the batch file, much less pass any arguments), what was the third-party utility trying to do? (And what was it trying to do it with?)
Apr 7, 2010
Thanks, Rex.

The utility I was referring to is CMake, or more accurately, CTest. I have a batch file that is a test driver for several hundred tests. CTest calls the batch file using the name of the executable to be run as the first argument. Even when I give CTest the full path to the test driver using windows-slashes, it converts the command to linux-slashes. I'm still researching, but I'm certain this is a bug and not a misconfiguration on my part. And, yes, it fails completely when run in CMD.EXE. When I have a bit more time, I'll research it further and report the bug to CMake. (Part of the issue, I'm sure, is that I need to use the Nightly builds of CMake due to bug fixes/enhancements that were made since their latest stable release. Very likely, some improvement broke it temporarily.)

Using TCMD has been the only way I've been able to get CTest to run these tests. I've worked around the problem of the batch file's ARGV1 by comparing ARG1 to ARG0 and shifting:

if "%0" = "C:%1" shift

Thanks for a wonderful product.
Last edited:
Similar threads
Thread starter Title Forum Replies Date
Charles Dye REGDIR /T : incorrect localization of time stamps Support 4
S incorrect message at start Cancel batch job 4START.bat ? (Y/N/A) : Support 1
rps Fixed @filesize[...,a] space allocated values incorrect Support 2
M TCC incorrect dir output since Windows 1803 Support 6
Fross @Words Incorrect? Support 19
Steve Pitts WAD @MD5 returns incorrect results for strings Support 2
Phil Kane WAD v 17 Displays Incorrect OS Support 6
rps Documentation "Select" command switch order incorrect Support 4
R Fixed Bytes Allocated Total Incorrect in V17 b52 Support 1
D Minor problem. Incorrect value internal var _dir_files Support 7
S WAD Incorrect _do_loop values Support 18
The Wizard WAD Possible Incorrect COMSPEC handling Support 2
Dan Glynhampton Documentation v15 help: Incorrect Links Support 0
JohnQSmith WAD Incorrect results from @FILESIZE Support 9
T @ping: response code, data size and documentation incorrect Support 2
N Incorrect display under TCMD 13 Support 1
dcantor @AGEDATE example incorrect in help Support 0
T Incorrect file associations Support 8
C TC10 LIST - print with line nbrs incorrect Support 0
D D:\Settings\Application contains an incorrect path? Support 0
Jesse Heines Using Regular Expressions with the REN commanc Support 8
R WAD Unusable state when using Chinese characters Support 3
Joe Caverly Using TYPE with non-English text Support 22
L Using TCC.exe through an SSH connection Support 3
Joe Caverly Using @PSHELL from @EVAL Support 8
Jay Sage Command Will Not Run Using Short Name of Path Support 5
Jay Sage Cannot Postion Cursor in Command Line Using Mouse Support 7
MikeBaas Using the debugger Support 2
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
Dick Johnson Using the @instr function Support 5
Joe Caverly Using this CMD technique from TCC Support 17
Joe Caverly What version and Windows OS are you using? Support 3
Craig Fitzgerald Problems using tcstart.btm Support 3
R How to? Append files in multiple subfolders using copy? Support 8
M Ctrl-C when using command line history does nothing Support 2
Joe Caverly Using a Directory Alias with @iniwrite fails Support 14
C French accents using msgbox Support 4
C "Failed to update the system registry. Please try using REGEDIT" Support 3
x13 Problem listing repository files using DIR http(s)://... Support 8
R Regex using ^ Support 2
cxxl WAD Mouse movement sluggish when using TCC list Support 3
jfalch WAD internal "which" should check for FILEEXIST when using AppPaths entry Support 8
D How to? Scale font in TCC using wheel mouse or other means Support 2
fpefpe Documentation copy/move using /c or /u Support 2
gschizas Fixed Using codepage 65001 (UTF-8) breaks non-ASCII characters Support 8
D How to? Use typed envars using regex. Support 3
epement Using "everything" Support 10
U Installing the Compaq Visual Fortran 6.0 compiler using Take Command Support 8
Alexander WAD The number of files and dirs are multiplied when using multiple wildcards Support 6
T using bottom line for status bar Support 3

Similar threads