# How to run a Mathematica program using command line on windows?

I have to run some Mathematica programs on a remote computer. The system of that computer is Windows XP. But I do not know how to run the program using command line on windows. Can you help me? Thank you very much!

-
Thank you. But this link does not include the way on windows. I know how to do on Linux. –  wxg Oct 15 '12 at 2:57
Try MathKernel reference.wolfram.com/mathematica/ref/program/MathKernel.html –  Verbeia Oct 15 '12 at 3:03

As indicated in the documentation, one can access the Mathematica kernel from the command prompt using the command math in Unix/Linux and MathKernel from Mac OS X/ Windows.

If the MathKernel command is not in your PATH variable, you can try one of several things:

1. Enter the full pathname as part of the command
2. Add MathKernel as a PATH variable using the instructions appropriate to your version of Windows. This will generally involve (a) right-clicking on the My Computer icon from the desktop and choosing Properties, then (b) clicking on a tab or button with the word Advanced in its label (it’s the Advanced System Settings link in Vista and later), and then (c) choosing the Environment Variables option.

3. Using the command prompt, navigate to the directory in Windows that stores the Mathematica kernel executable, as described in this page in the Mathematica documentation.

This documentation page collects all the relevant commands together.

There are several relevant tutorials in the documentation, including on use of the text-based interface and a listing of command-line options and environment variables.

-
I have tried MathKernel in cmd on Windows. But it said thtat something like "MatheKernel is not a command". How to install the command? –  wxg Oct 15 '12 at 4:39
@wxg MathKernel is not in your PATH variable. Enter the full path name and it will work. –  Ajasja Oct 15 '12 at 5:49
@Ajasja I have tried as you suggested. Can you tell me how to add MathKernel in the PATH variables? So I can simplely use MathKernel. –  wxg Oct 15 '12 at 6:37
@wxg here you go: computerhope.com/issues/ch000549.htm also you have to restart cmd so that the changes will take effect. –  Ajasja Oct 15 '12 at 7:51
@wxg You could also navigate to the directory in Windows where the executable is stored, C:\Program Files\Wolfram Research\Mathematica\8.0, according to reference.wolfram.com/mathematica/tutorial/… –  image_doctor Oct 15 '12 at 10:16