How to change the default directory? [resolved]

Hello,
how can I change my current directory (it is by default the home directory)?

> "/Users/Name"

I don’t want to use “SetDirectory[…]” in each notebook. So I want to change the default directory global!!!

Cheers

Philipp

Philipp,

Here is one way to do it. Open the kernel initialization file:

init = FileNameJoin[{$UserBaseDirectory, "Kernel", "init.m"}];
stream = OpenAppend[init]

Write the expression you want to be evaluated in each kernel session:

Write[init, Unevaluated[SetDirectory["/Users/Philipp/subdirectory"]]]

Close the file:

Close[stream]

Inspect the contents:

FilePrint[init]

Or use SystemOpen to edit the file manually:

SystemOpen[init]

Thank you very much. It works beautiful.