I am trying to configure dymola.mos file, here is an example of changing directory, but when I activate Dymola, it seems the working directory doesn't change at all, even though the log shows Dymola run the script.
My question is:
How could I make the cd command work in the dymola.mos file?

- 1,094
- 6
- 16
1 Answers
I assume you have activated the option Save startup directory. You can check this with the flag Advanced.StartupDirectory
, which will be either 1 or 2. You can simply turn that off or follow the steps below.
From your command log we see that:
- Dymola first executes the script
<install-path/insert/dymola.mos
- Then it restores the settings stored in
setup.dymx
Hence the settings in setup.dymx
override your working directory.
Instead of using <install-path/insert/dymola.mos
you should use a custom .mos
script, which is passed as first argument to dymola.exe
on startup. This will always be executed last.
Example for Windows
Create the file
startup.mos
somewhere, e.g. inC:\dymola\startup.mos
Create a shortcut to
Dymola.exe
, (for Dymola 2021x:C:\Program Files\Dymola 2021x\bin64\Dymola.exe
)Add the .mos script as argument in the
Target field
in the properties of the shortcut. The result will be:"C:\Program Files\Dymola 2021x\bin64\Dymola.exe" "C:\dymola\startup.mos"

- 5,944
- 10
- 22