>
> On Wed, Nov 3, 2010 at 9:09 PM, Richard Heck <[email protected]> wrote:
>
>>
>> Can someone on Windows explain the right thing to do here?
>>
>
Shucks, I guess I'll give it a go.

Go to the command line (windowsbubble>run>cmd).
Type in our command.
C:\Users\MyName>lyx.exe -help
'lyx.exe' is not recognized as an internal or external command,
operable program or batch file.
What does that mean? It means your computer does not know where to find that
file (lyx.exe). It's actually in a folder that will be something like
"C:\Program Files\LyX 1.6.7\bin" At least, that's where I found mine. Once
you find it, you will find that the command they tell you does in fact work.

First, we have to go to where the file lives.
C:\Users\MyName>cd C:\Program Files\LyX 1.6.7\bin
We can verify that the file is here with
C:\Users\MyName>dir
Now, we type the command
C:\Users\MyName>lyx.exe -help
and it works.

Now, if we want to shortcut things, and run "lyx.exe" without having to do
C:\Users\MyName>cd C:\Program Files\LyX 1.6.7\bin
then we can add "C:\Program Files\LyX 1.6.7\bin" to the path. Path is a
predefined variable, and basically, whenever you want to execute a program,
the operating system will look for the file. It won't look everywhere, but
only in the directories stored in the "path" variable. To see what's in your
path, go there on the command line and type "path":
C:\Users\MyName>path
PATH=C:\Program Files\MiKTeX
2.8\miktex\bin;C:\Windows\system32;C:\Windows;C:\Wi
ndows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files
\MATLAB\R2009a\bin;C:\Program Files\MATLAB\R2009a\bin\win32;C:\Program
Files\Tor
toiseSVN\bin;C:\Program Files\Dia\bin;C:\MinGW\bin
Now you get to see what's stored in my path variable.

Suppose we want to add our directory to the path. To do this we right-click
my computer>properties>advanced system settings>advanced, then click
"environment variables" This is how I get there on Windows 7, XP is similar,
but it seems like it's not buried quite as deep. Anyway, now we get to edit
the variables. You can either change the user variables or the system
variables. If you change the user variables only, it will not affect other
users on the computer. If you change the system variables, it will be
system-wide. I usually do things system-wide. We now go to the system
variable "path" and click "edit". We go to the end of this very long list,
and place a semicolon after the last entry, then paste "C:\Program Files\LyX
1.6.7\bin" without the quotes, and okay ourselves out of there. You have to
exit the terminal window, and start a new one before the variable will be in
the path.
Open a new terminal window (windowsbubble>run>cmd).
Now check the path variable.
C:\Users\MyName>path
PATH=C:\Program Files\MiKTeX
2.8\miktex\bin;C:\Windows\system32;C:\Windows;C:\Wi
ndows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files
\MATLAB\R2009a\bin;C:\Program Files\MATLAB\R2009a\bin\win32;C:\Program
Files\Tor
toiseSVN\bin;C:\Program Files\Dia\bin;C:\MinGW\bin;C:\Program Files\LyX
1.6.7\bi
n

Horay! It's there.

Now, we test our command from anywhere in the command prompt, and we get:
C:\Users\MyName>lyx.exe -help
Usage: lyx [ command line switches ] [ name.lyx ... ]
Command line switches (case sensitive):
        -help              summarize LyX usage
        -userdir dir       set user directory to dir
        -sysdir dir        set system directory to dir
        -geometry WxH+X+Y  set geometry of the main window
        -dbg feature[,feature]...
                  select the features to debug.
                  Type `lyx -dbg' to see the list of features
        -x [--execute] command
                  where command is a lyx command.
        -e [--export] fmt
                  where fmt is the export format of choice.
                  Look on Tools->Preferences->File formats->Format
                  to get an idea which parameters should be passed.
        -i [--import] fmt file.xxx
                  where fmt is the import format of choice
                  and file.xxx is the file to be imported.
        -f [--force-overwrite] what
                  where what is either `all' or `main'.
                  Using `all', all files are overwritten during
                  a batch export, otherwise only the main file will be.
                  Anything else is equivalent to `all', but is not consumed.
        -version        summarize version and build info
Check the LyX man page for more details.

Everything is in order. I hope this gets you going. You can also add
variables to the path from the command line, but I think one way to get the
job done is sufficient for an answer.

Jacob

Reply via email to