# [tex-live] Passing a valid Windows path and file name to *TeX in TeXlive

Martin Heller mr_heller at yahoo.dk
Tue Jun 10 09:20:38 CEST 2014

```I am working on a windows system using TeXlive 2013

pdflatex -version

pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)
kpathsea version 6.1.1
Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh
(pdfTeX).
Compiled with libpng 1.5.16; using libpng 1.5.16
Compiled with zlib 1.2.7; using zlib 1.2.7

pdftex can be invoked in different ways. In particular, from `pdftex
--help` I expected pdftex to first look if the provided non-option
argument is a file and process the file if it exists. Subsequently, the
alternative possibilities should be tried:

Alternatively, if the first non-option argument begins with a
backslash,
interpret all non-option arguments as a line of pdfTeX input.

Alternatively, if the first non-option argument begins with a &, the
next word is taken as the FMT to read, overriding all else. Any
remaining arguments are processed as above.

Hovever, providing a valid full path to a tex file fails on Windows in
many cases. Given that the file
"c:\Documents and Settings\test.tex" exists, the following works as
expected

pdflatex "c:\Documents and Settings\test.tex"

Using the 8.3 path name fails (pdftex tries to interpret the path as a
line of pdfTeX input = alternative 1)

pdflatex c:\Docume~1\test.tex

! I can't find file `c:/Docume'.
\protect
<*> c:/Docume~
1/test.tex
(Press Enter to retry, or Control-Z to exit)
Please type another input file name:

Escaping the tilde by \string and changing \ to / makes the 8.3 path
work (but this should look for a file with the full path
"c:\Docume\string~1\test.tex").

pdflatex c:/Docume\string~1/test.tex

Why is pdflatex interpreting the line in the first place? Non-option
arguments should only be interpreted if they begin with a backslash?

If I invoke pdflatex using

pdflatex "\\?\c:\Documents and Settings\test.tex"

it also fails because it interprets the argument as TeX input. However,
the path is valid and should not be interpreted as a line of TeX input
but rather be processed as a file?

Is the above expected behavior? If yes, I think the wording in the help
text is misleading or at least it confuses me.

```