15

I have to run some Mathematica programs on a remote computer running the Windows XP operating system. However, I do not know how to run the program using the command line on this system.

What do I need to do in order to run Mathematica code remotely on Windows XP?

dionys
  • 4,321
  • 1
  • 19
  • 46
wxg
  • 443
  • 3
  • 9

1 Answers1

16

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.

jjc385
  • 3,473
  • 1
  • 17
  • 29
Verbeia
  • 34,233
  • 9
  • 109
  • 224
  • 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 04:39
  • 2
    @wxg MathKernel is not in your PATH variable. Enter the full path name and it will work. – Ajasja Oct 15 '12 at 05: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 06:37
  • @wxg here you go: http://www.computerhope.com/issues/ch000549.htm also you have to restart cmd so that the changes will take effect. – Ajasja Oct 15 '12 at 07: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 http://reference.wolfram.com/mathematica/tutorial/MathematicaFileOrganization.html – image_doctor Oct 15 '12 at 10:16
  • Thanks @Ajasja and image_doctor - I have added your suggestions and made the post community wiki in recognition of the joint contributions. – Verbeia Oct 15 '12 at 10:37
  • @Verbeia You needn't have made this a community wiki: you did all the work. Two comments hardly count as joint contributions:) – Ajasja Oct 15 '12 at 10:46
  • @Ajasja - I always count the contribution as how much effort it would have taken me to work out. I'm no Windows export, so those bits would have taken me a while. I got 60 points out of it before I switched it, which is plenty given the kind of answer it is. – Verbeia Oct 15 '12 at 11:05
  • @Verbeia most kind of you. – image_doctor Oct 15 '12 at 17:01
  • 2
    As of September 2015, a number of the links to Wolfram pages are no longer valid. I tried to find the correct links to update the answer, but failed miserably. – bobthechemist Sep 02 '15 at 15:38
  • 1
    WolframKernel aka MathKernel page with command line keys lives here – garej Nov 30 '15 at 16:47