Skip to main content

files and directories - Where can I permanently modify Directory[]?


First I set


SetDirectory["F:\\learning_mma"];Directory[](*ok,success*)

and then I quite the kernel:


Quit[]


an then


Directory[]

it output the "C:\\Users\\Administrator\\Documents". So how can I modify Directory[] permanently?



Answer



You can run SetDirectory in the kernel initialization file, init.m. You'll find it here:


SystemOpen@FileNameJoin[{$UserBaseDirectory, "Kernel"}]

Comments