Archived from groups: microsoft.public.windowsxp.customize (More info?)
I want to write me a little batch file that gets passed the filename of
a .tex file and then invokes LaTeX on it:
e.g. it is called as:
mybatchfile C:\foo\bar.tex
it should then first switch to the directory of the file whose name it
got passed and then execute LaTeX on it, i.e.:
--------------------------
cd C:\foo
C:\Programs\MiKTeX\bin\latex C:\foo\bar.tex
--------------------------
How can one extract the directory from a filename in a batch file, i.e.
how do I derive the substring "C:\foo" from the passed parameter
"C:\foo\bar.tex" using cmd's built-in functions?
"Michael Moser" <michael-nospam.moser@nospam.freesurf.ch> wrote in message newshf2Y05VFHA.3176@TK2MSFTNGP12.phx.gbl...
>I want to write me a little batch file that gets passed the filename of
> a .tex file and then invokes LaTeX on it:
>
> e.g. it is called as:
> mybatchfile C:\foo\bar.tex
>
> it should then first switch to the directory of the file whose name it
> got passed and then execute LaTeX on it, i.e.:
> --------------------------
> cd C:\foo
> C:\Programs\MiKTeX\bin\latex C:\foo\bar.tex
> --------------------------
>
> How can one extract the directory from a filename in a batch file, i.e.
> how do I derive the substring "C:\foo" from the passed parameter
> "C:\foo\bar.tex" using cmd's built-in functions?
>
> Michael
>
>
>
>
You are about to answer a thread that has been inactive for more than 6 months. If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.