There might be a few misconceptions here:
Starting Octave with the command line argument
--eval starts Octave, evaluates the corresponding command and closes Octave when that evaluation is done.
uiwait takes a graphics handle as its input argument and “stalls” execution as long as that graphics handle is valid – thus, delaying closing Octave. See
So, your batch file starts Octave and tries to evaluate
uiwait(myscript.m). Like you can confirm by evaluating that command manually at the command prompt, that results in an error.
After that, execution continues and – since nothing else is to be done ( no
try ... catch or whatever…) – Octave closes.
Maybe you wanted to run the script
myscript.m (it’s not a function!)?
That could be done e.g. with the following line in the batch file:
C:\Octave-6.3.0\octave.vbs --no-gui -p C:\Users\Nicola\Desktop\09_Programma\Prova --eval myscript