2
$\begingroup$

How can I configure the initial directory? By configure, I mean set it so that when Mathematica starts the initial directory is one of my choosing.

By the by, what exactly is the significance of the initial directory? Is that the default location of where a notebook gets saved?

$\endgroup$

2 Answers 2

2
$\begingroup$

The answer to your question is system dependent. The value of $InitialDirectory is very different on OS X, say, than on Windows or Linux. I recommend you evaluate

?"*Directory"

The result is an array of buttons, each -- when clicked on -- will give you a brief description of the Mathematica symbol it displays all of which will have some relation to directories. At the end of the brief description you see a >>. This is a link. Clicking on it will bring up the documentation page for the given symbol.

$InitialDirectory will be displayed on one the buttons in the array along with many other system symbols Mathematica maintains for storing the full path names of directories that are important to it. You can learn a lot about how Mathematica relates to directories by exploring the button array,

On my system, which is OS X, $InitialDirectory doesn't seem to be very important unless you are running Mathematica from the command line in Terminal.

$\endgroup$
0
$\begingroup$

I haven't figured out how to alter $InitialDirectory, but this met my need.

  1. Run: SystemOpen@FileNameJoin[{$UserBaseDirectory, "Kernel"}]
  2. Open init.m found there.
  3. Add something like: SetDirectory@FileNameJoin[{$UserDocumentsDirectory, "Mathematica"}];.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.