[Tex/LaTex] Using 8.3 path names with pdfLaTeX

pathspdftexwindows

I am trying to run pdfLaTex on a file that is in a path stored in an environment variable in my Windows environment (e.g. the %TEMP% directory). The path is stored using it's 8.3 DOS name. This seems to upset pdfLaTeX and it breaks the path name at the first ~.

Is it somehow possible to pdfLaTeX using the 8.3 path name of the source? Below is a short command line extract that shows the problem:

C:\>echo \stop > "c:\Documents and Settings"\test.tex

C:\>REM This works

C:\>pdflatex "c:\Documents and Settings\test.tex"
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)
 restricted \write18 enabled.
entering extended mode
(c:/Documents and Settings/test.tex
LaTeX2e <2011/06/27>
Babel <3.9k> and hyphenation patterns for 78 languages loaded.
 )
No pages of output.
Transcript written on test.log.

C:\>REM This does not work

C:\>pdflatex c:\DOCUME~1\test.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)
 restricted \write18 enabled.
entering extended mode
! I can't find file `c:/DOCUME'.
<to be read again>
                   \protect
<*> c:/DOCUME~
              1/test.tex
(Press Enter to retry, or Control-Z to exit)
Please type another input file name:
! Emergency stop.
<to be read again>
                   \protect
<*> c:/DOCUME~
              1/test.tex
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.

C:\>REM But the file is there

C:\>dir c:\DOCUME~1\test.tex
 Volume in drive C is OS
 Volume Serial Number is C642-601C

 Directory of c:\DOCUME~1

06-06-2014  18:42                 8 test.tex
               1 File(s)              8 bytes
               0 Dir(s)  93.225.000.960 bytes free

C:\>

Best Answer

You can use

pdflatex \input{c:/DOCUME\string~1/test.tex}

or probably

set TEXINPUTS=%TEMP%;
pfdflatex test

will also work.

I would also have expected

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

to work but I can't test on a native windows tex.