Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a folder with hundreds of small PDF files to print.
How can I make a batch job to print them out in alphabetical order?

share|improve this question
dir /b | sort > %temp%\files.tmp
for /f %f in (%temp%\files.tmp) do AcroRd32.exe /t %f "\\servername\printername"
del %temp%\files.tmp
share|improve this answer
thanks for your solution. anyway how come windows explorer sorts files in a different order? – Jess Stone Feb 10 '14 at 8:27
nobody knows why ? – Jess Stone May 7 '14 at 9:23

Details here about silent print command in Adobe reader.

so you can do (batch file):

for %%X in (*.pdf) do AcroRd32.exe /t %%X "\\servername\printername"

or (cmd prompt):

for %X in (*.pdf) do AcroRd32.exe /t %X "\\servername\printername"
share|improve this answer
Hi this does not guarantee the print in alphabetical order. :( – E_M Mar 5 '10 at 11:44
Well, it does the same as a standard DOS dir *.pdf so it should be in order... – Shevek Mar 5 '10 at 12:02
try this to prove the sort order: for %X in (*.pdf) do echo %X – Shevek Mar 5 '10 at 12:06
don't work... just try. I create files: 3.pdf, 1.pdf, 2.pdf in a folder. then your command: C:\1>for %X in (*.pdf) do "C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.ex e" /t %X C:\1>"C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe" /t 1.pdf C:\1>"C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe" /t 2.pdf C:\1>"C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe" /t 3.pdf but in the printer I found this order of printing: 2-1-3. LOL! :) – E_M Mar 5 '10 at 12:08
that doesn't make sense!!! if the command is executed 1,2,3 then it should print 1,2,3... – Shevek Mar 5 '10 at 16:37

I know this isn't stackoverflow, but the only way I could do this would be in python.

Recepie for printing pdf file:

from win32com import client
import time

ie = client.Dispatch("InternetExplorer.Application")

def printPDFDocument(filename):


    if ie.Busy:



Recepie for list all files from a dir:

   import os
   path="C:\\somedirectory"  # insert the path to the directory of interest here

Recepie for sorting alfabetically the list of files:

a.sort()  # a is the list

Well just by joining the 3 recepies, you can have your problem solved.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.