Skip to main content

I've read a number of questions and answers about this and wasn't able to accomplish it. So if this is really a duplicate please direct me to a previous question that can help.How can I schedule custom Mathematica code to run on my windows machine?

Ultimately I will haveneed to schedule a notebook that I've writtensome code to run on my computer (Windows, Mathematica 10. Right now I'm just0). I'm trying to get something to run via a command prompt so that I know I'm on the right track. Which I clearly am not.

I wroteI'm under the following test code, and put a Begin[] and End[] in it, which I think makes it a package. As I read it seemsimpression that I wouldn't be able to run a .nb file from a command line. The, so I've written the following test code isusing 'Begin' and 'End', which I think makes it a package:

BeginPackage["mkTest`"]
Print["abc"]
a = {{1, 2, 3}, {7, 6, 5}};
Export[NotebookDirectory[] <> "\\test.xlsx", "testCmd" -> a];
End[]

I putI've placed this rightdirectly in the Mathematica folder to get rid of some "variables". C:\Program Files\Wolfram Research\Mathematica\10.0

"C:\Program Files\Wolfram Research\Mathematica\10.0"

The following is a screen print of various command line attempts:

screen print of my attempts

It seems the code isn't working or I'm not calling it properly, since no Excel file appears in my directory. Each of these attempts resulted in a window such as the following:

result of my attempt

Also no Excel file appeared in my directory.

I've never tried to write a package before. I actually don't know if I do need to write a package. Can anyone tell me how to run Mathematica code from a Windows command line?

  1. Is it necessary to write a package to run Mathematica code at the command line?

  2. Can anyone point out why my attempts above fail?

  3. How can I schedule custom Mathematica code to run on my windows machine?

I've read a number of questions and answers about this and wasn't able to accomplish it. So if this is really a duplicate please direct me to a previous question that can help.

Ultimately I will have to schedule a notebook that I've written. Right now I'm just trying to get something to run via a command prompt so that I know I'm on the right track. Which I clearly am not.

I wrote the following test code, and put a Begin[] and End[] in it, which I think makes it a package. As I read it seems that I wouldn't be able to run a .nb file from a command line. The code is:

BeginPackage["mkTest`"]
Print["abc"]
a = {{1, 2, 3}, {7, 6, 5}};
Export[NotebookDirectory[] <> "\\test.xlsx", "testCmd" -> a];
End[]

I put this right in the Mathematica folder to get rid of some "variables". C:\Program Files\Wolfram Research\Mathematica\10.0

The following is a screen print of various command line attempts:

screen print of my attempts

Each of these resulted in a window such as the following:

result of my attempt

Also no Excel file appeared in my directory.

I've never tried to write a package before. I actually don't know if I do need to write a package. Can anyone tell me how to run Mathematica code from a Windows command line?

How can I schedule custom Mathematica code to run on my windows machine?

I need to schedule some code to run on my computer (Windows, Mathematica 10.0). I'm trying to get something to run via a command prompt so that I know I'm on the right track.

I'm under the impression that I wouldn't be able to run a .nb file from a command line, so I've written the following test code using 'Begin' and 'End', which I think makes it a package:

BeginPackage["mkTest`"]
Print["abc"]
a = {{1, 2, 3}, {7, 6, 5}};
Export[NotebookDirectory[] <> "\\test.xlsx", "testCmd" -> a];
End[]

I've placed this directly in the Mathematica folder:

"C:\Program Files\Wolfram Research\Mathematica\10.0"

The following is a screen print of various command line attempts:

screen print of my attempts

It seems the code isn't working or I'm not calling it properly, since no Excel file appears in my directory. Each of these attempts resulted in a window such as the following:

result of my attempt

  1. Is it necessary to write a package to run Mathematica code at the command line?

  2. Can anyone point out why my attempts above fail?

  3. How can I schedule custom Mathematica code to run on my windows machine?

Source Link

Running Mathematica code from a command line

I've read a number of questions and answers about this and wasn't able to accomplish it. So if this is really a duplicate please direct me to a previous question that can help.

Ultimately I will have to schedule a notebook that I've written. Right now I'm just trying to get something to run via a command prompt so that I know I'm on the right track. Which I clearly am not.

I wrote the following test code, and put a Begin[] and End[] in it, which I think makes it a package. As I read it seems that I wouldn't be able to run a .nb file from a command line. The code is:

BeginPackage["mkTest`"]
Print["abc"]
a = {{1, 2, 3}, {7, 6, 5}};
Export[NotebookDirectory[] <> "\\test.xlsx", "testCmd" -> a];
End[]

I put this right in the Mathematica folder to get rid of some "variables". C:\Program Files\Wolfram Research\Mathematica\10.0

The following is a screen print of various command line attempts:

screen print of my attempts

Each of these resulted in a window such as the following:

result of my attempt

Also no Excel file appeared in my directory.

I've never tried to write a package before. I actually don't know if I do need to write a package. Can anyone tell me how to run Mathematica code from a Windows command line?