Batch files only opens some files
Posted: 11 Oct 2021 03:35
Hello,
I'm using the following list of commands to launch an application and open documents in the same instance, ie. the application is only launched once:
For some reason, only some of the docs are opened and others are ignored.
It looks random, so I suspect it's a timing issue.
Any idea what it could be?
Thank you.
---
Edit: I think I found the cause. Some filenames have accents in them ("é", "à", etc.), and it causes cmd/the application to fail loading the file.
For some reason, it works when copy/pasting/running each command manually, accents and all.
I'm using the following list of commands to launch an application and open documents in the same instance, ie. the application is only launched once:
Code: Select all
REM open.docs.cmd
start " " "C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance "C:\Doc1.pdf"
start " " "C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance "C:\Doc2.pdf"
start " " "C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance "C:\Doc3.pdf"
etc.
It looks random, so I suspect it's a timing issue.
Any idea what it could be?
Thank you.
---
Edit: I think I found the cause. Some filenames have accents in them ("é", "à", etc.), and it causes cmd/the application to fail loading the file.
For some reason, it works when copy/pasting/running each command manually, accents and all.