Message Boards Message Boards

0
|
7037 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

How to change the default directory? [resolved]

Posted 10 years ago

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

POSTED BY: Philipp Krönert
2 Replies

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]
POSTED BY: Arnoud Buzing

Thank you very much. It works beautiful.

POSTED BY: Philipp Krönert
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract