# SetDirectory - predefined directory possible? [duplicate]

Possible Duplicate:
Relative paths for portable notebooks in Mathematica

I have a deep subdirectory structure, and the calculations should always be done in one of the deepest subdirectories. Instead of clicking through it using the SetDirectory command, is it possible to predefine somehow at the very first beginning of the notebook the second deepest subdirectory as a working directory, so that I can choose with SetDirectory just one of the deepest subdirectories?

-

## marked as duplicate by rm -rf♦, whuber, F'x, Sjoerd C. de VriesAug 26 '12 at 21:24

Navigate to Format >> OptionInspector select Global Preferences and set NotebookBrowseDirectory and NotebookPath
I do the following: inside the directory I would like to be a working directory, create a blank mathematica notebook, and in your .bashrc or .profile, define a global variable that stores the path to the notebook. From the command line, just type mathematica \$pathname/notebookname.nb & and you will have mathematica launch in the correct working directory. You can then populate the notebook. I have tested this in Unix and OS X, and I think something similar might work on Windows. The disadvantage is that this is OS based(and requires you to modify your bashrc)--breaks across machines. –  Y.P. Jul 27 '12 at 18:06