It took me a lot of searching on Octave wiki, documentation etc., to finally find a way to change Octave working directory at startup; when typing system('set')
at the Octave command prompt, it lists all environment variables, i.a. USERPROFILE=C:\Users\me
. But I want the program to load C:\Users\me\Octave
instead.
A possible solution consists in adding the following lines
setenv("USERPROFILE", "C:\\Users\\me\\Octave");
cd(getenv("USERPROFILE"));
to C:\Octave\Octave-4.0.3\share\octave\4.0.3\m\startup\octaverc
.
However, this appears a bit clumpsy to me. It changes the environment variable USERPROFILE
at each Octave startup and then tells the program to use it as the working directory.
Isn't there a way to permanently change USERPROFILE
, maybe on the Windows command line?