Angus Leeming wrote:
On Tuesday 14 June 2005 21:34, Andre Poenitz wrote:
On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote:
if "%LANG%"=="" SET LANG=no_NO
lyx.exe %*
[...]
Second line starts the lyx executable and passes any parameters
to it. The script is tested on windows XP. (I don't have lyx for
windows, but the LANG test and parameter passing works fine.)
I don't think it works on older Windows versions. I've seen
%1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume
that it can't be a mere oversight of lazy programmers...
I tested with windows98 - windows98 don't support .cmd files
(they have to end in .bat instead), and there is no support for %*
So it depends on how old windows versions you want to support.
Of course %1 %2 %3 ... works on newer windows too, but limits you
to 9 arguments. (You can probably get more by using some
ugly tricks with the "shift" command...)
In that case, shouldn't it be
lyx.exe "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9"
No, that will turn
lyx.bat "file with spaces.lyx"
into
lyx.exe ""file with spaces.lyx"" and that won't work too well.
The windows shell is like most other ms software - not well planned
for corner cases.
If you pass a filename with quotes to a windows batchfile, then
the quotes are preserved as part of the %1 variable. Any
subsequent use of %1 will retain the quotes. So they shouldn't
be necessary, at least not on windows98.
Helge Hafting