Reputation: 1232
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?
Upvotes: 0
Views: 110
Reputation: 6645
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:
<install-path/insert/dymola.mos
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.
Create the file startup.mos
somewhere, e.g. in C:\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"
Upvotes: 3