1

On Initialization & Provisioning at

http://reference.wolfram.com/language/guide/InitializationAndProvisioning.html

the WolframScript Command-Line Options mention -preinit and -postinit.

I am trying to set a variable using -preinit in a shortcut, e.g.

"C:\Program Files\...\11.2\Mathematica.exe" -preinit "C:\dir\set.nb"

but it just opens the notebook instead of running it.

Can I get -preinit to initialize a variable?

Chris Degnen
  • 30,927
  • 2
  • 54
  • 108
  • 1
    That looks like it is for Wolfram Script, not Mathematica. I'm not sure they share the same options. See https://www.wolfram.com/wolframscript/. If you wanted to initialize a variable for Mathematica, you would need to edit one of your init.m files. http://reference.wolfram.com/language/ref/file/init.m.html – ktm Jan 03 '18 at 17:18
  • @user6014 Yes, Wolfram Script makes sense. Thanks. By the way, I'm using $PreInitialization to load an init.m file from a convenient location. I was hoping to pass the path in with -preinit, but I can do something else. – Chris Degnen Jan 04 '18 at 09:03

0 Answers0