Launch first time, refresh only subsequently


I have a batch script that, first, produces a new PDF file, and then, second, launches it in SumatraPDF for viewing.

The problem is that each time I run the batch script, it launches a new / another instance of SumatraPDF. Within no time, I have a dozen instances of SumatraPDF open, each showing the latest version of the (same) PDF.

Is there some way to lauch SumatraPDF the first time, but only refresh its view each subsequent time it is called?

Thanks and regards,


Editors that constantly rebuild pages need exactly that function
It is the reason for the setting ReuseInstance = true
in the settings file so check that is working

SumatraPDF expects a file that is to be auto refreshed in situ to
Have exactly the same path and name each time it is called not incrementing
e.g. file (2).pdf is not the same filename as file (1).pdf
So as not to block creation of the same file (if over 10 or 32Mb file locking limits)
it may be necessary to workaround by use of scripting

Although your case is effectively opposite to Make a new file open in the current window instead of the new window
you seem to be experiencing a similar problem and the key is as discussed there the need to ensure it is the same filename each time.