Two documents open from script instead of one

I am working with Libre Office 5 on Ubuntu 16.4. Everything is placed as a live-system on a USB-memory.
I have a script wich asks the user for a name and the scripts creates a file from a template with the users name and adds date and time. So the filename will be like Paul_Simon_20161213_1104.rtf

The script opens this file in Libre office Writer. That works but an additional file named “Untitled 1 (Remote)” opens too!
I wonder why does it happen and how can i avoid it. I use the USB here att our school to write exams without internet connection and access to the hard drive. An additional file is not a bug deal but it may irritate the students.

Hi

Difficult to get an idea without the script. You also do not indicate whether the additional document is an empty document or a copy of the document created from the template.

If it is an empty document you can try, for example, to start LibreOffice with a command line like (where MyCreatedDoc.odt is the “good” document to open):

soffice.exe --nodefault -o c:\Test\MyCreatedDoc.odt

[EDIT]
See help on parameters.

I increased your karma so that you could possibly upload a document.

Regards

Sorry for my late response. I discovered another weird thing: The additional file comes up only the first time after the start of the live system. i works fine the then. Can there be timing issues?

How ever here is the start script. (I took out a bunch of echo):

link text