CarLaTeX
CarLaTeX

Reputation: 305

In a batch process, is there a way to close only a document in Acrobat Reader DC?

In a batch process, on Windows 10, I'm using this command:

taskkill /IM AcroRd32.exe & exit /b 0

to close Acrobat Reader DC.

It works perfectly for my needs, but sometimes I want to close only one of the documents open in Acrobat Reader at the moment of the run, not all (as it happens now, obviously, closing Acrobat).

Is there a way to do it?

Suppose I have opened in Acrobat three files: A, B, and C. (I have the Italian version):

enter image description here

Document C is the one I'm reading.

If I launch:

tasklist /v /FI "IMAGENAME eq Acro*"

I got:

Nome immagine                  PID Nome sessione    Sessione n. Utilizzo mem Stato           Nome utente
                               Tempo CPU Titolo finestra
========================= ======== ================ =========== ============ =============== ================================================== ============ ========================================================================
AcrobatNotificationClient    18196 Console                    5      1.608 K Running         my_pc\my_path
                                 0:00:00 N/D
Acrobat.exe                  21000 Console                    5     71.428 K Running         my_pc\my_path
                                 0:00:00 C.pdf
Acrobat.exe                  20280 Console                    5    202.880 K Running         my_pc\my_path
                                 0:00:01 C.pdf - Adobe Acrobat Reader (64-bit)
AcroCEF.exe                  11656 Console                    5     53.160 K Running         my_pc\my_path
                                 0:00:01 N/D
AcroCEF.exe                  11736 Console                    5     21.544 K Unknown         my_pc\my_path
                                 0:00:00 N/D
AcroCEF.exe                  20804 Console                    5     29.332 K Unknown         my_pc\my_path
                                 0:00:00 N/D
AcroCEF.exe                  13560 Console                    5     84.172 K Unknown         my_pc\my_path

I see only C.pdf, how can I close only A.pdf or B.pdf?

Upvotes: 1

Views: 365

Answers (1)

kw217
kw217

Reputation: 476

You can do this with the /FI argument to taskkill, e.g.,

  taskkill.exe /FI "WINDOWTITLE eq article.pdf"

Upvotes: 1

Related Questions