Copy link to clipboard
Copied
Hello.
I am trying to close a PDF file (under Win10) using CMD using TASKKILL [/S system [/U username [/P [password]]]] { [/FI filter] [/PID processid | /IM imagename] } . I am using Adobe Reader DC.
It works fine. However, when I have more than 1 PDFs open, it will close all documents.
So my question is: Is there a way to specifically close a "filename.PDF" document only without closing other PDFs that are open?
I appreciate any help. Thank you.
Copy link to clipboard
Copied
There is a shared task for all PDFs. Often more than one task, but still shared. There is an API to Acrobat, but I don't think you have one to Reader.
Copy link to clipboard
Copied
Thank you for a speedy reply.
Reason I needed it was because I am using <Acrobat path> /A "<parameter>=<value>" "<PDF path>" from CMD to open a PDF to a certain page number. However, once opened, if user does not close the PDF, and the above command is sent again with a different page number, then it just brings up the already opened PDF at whatever page was opened previously. That is why I was trying to use taskkill to close it before opening it again to the specified page.
If you know of another way, it would be appreciated.
Thanks so much!
Copy link to clipboard
Copied
For those interested, I found a work around by using /n to open new instance of Adobe Reader.
Sample command: <Acrobat path> /n /A "<parameter>=<value>" "<PDF path>"