Can you set default save directory from script?

I’ve written a script for data analysis that does what I need, but the data reduction step outputs files into whatever directory I was last using in the GUI unless I remember to change the default save directory. Is there a way of changing the default directory from a script?
I’ve found that I need to change the Mantid.User.Properties file as in this link:

but this suggests restarting mantid is then needed. I know this can be done without restarting in the gui. Is it possible to script?

Hi Ian,

You can see the current default save directory with
and set it with
ConfigService.Instance().setString('', 'path/to/dir')

This will change it for the current session - if you look under File/Manage User Directories then the default save directory will be changed. To write the changed value to the file, use

Hope this helps,

Thanks Tom, Works great!