# Batch File Printing

I have a user that has to print out about 220 documents averaging 2-3 pages each. When printed using the standard Windows method of Select All - Right-click - Print it overwhelms either the print server or the printer itself. I am looking for a utility that will allow me to process say 5 documents at a time that will do all of the documents in a given directory. I am hoping this will alleviate strain on the print server and will also allow the user to not have to babysit his print jobs. I found one that lets you schedule a print job for a certain time, but (and maybe this isn't a deal breaker) the spelling in the program is atrocious.

-

You could Try DarkStorm's batch print handler Its Free! :-)

DarkStorm's batch print handler is a .Net application that will batch print documents. DarkStorm's batch print handler automates Word/Excel and Adobe Reader to help the batch printing process, also provides support for some popular image formats.
I Haven't been able to test it though

Alternatively:

You could write a simple script that takes names from a text file and prints them at certain intervals. You could query the contents of the print folder to get the document names, put them in a text file and then loop through the text file with a wait inbetween until all documents are printed.

Pseudo Code would look something like this.

Populate Text File Function ()
{
Set Folder Path
Get Document Names in folder
Write Document Names to Text File
}
Print Function
{
While Not End of File{
Get Document Name
Print Document Name
Move down 1 line
Wait a timed interval
}
}


My coding isn;t what it used to be so I may have missed a few bits but I think its reasonably there. I would reccomend Guys Scripting Enzine to scour for code samples. You should be able to cut and paste most of the code you need.

-
wow - DarkStorm's batch print handler is nice. –  Sathya Nov 11 '10 at 15:43
Downloading now. All the scripting is nice, but I would rather not go that route. Going to test DarkStorm. –  chrispt Nov 11 '10 at 19:06
I think that DarkStorm app will be good. The only thing that would be sweet if they added the functionality is the ability to schedule the batch to run at a certain time so you could have it automatically kick off when you are gone for the day. –  chrispt Nov 11 '10 at 19:15

This is a job for the command line.

With Cygwin, the following script (which you can type on a bash command line) will print every PDF file in the current directory, one every 5 seconds.

for x in *.pdf; do cygstart -p -- "\$x"; sleep 5; done


If you don't want to install Cygwin (which is useful for many other things), see Sathya's answer for a cmd way (it's a little less straightforward). The choice tool would be Powershell, which surely has all the required building blocks (but I don't speak Powershell).

-
cmd has an equivalent of sleep --> crude replacement would be ping localhost -n 6 >NUL –  Sathya Nov 11 '10 at 15:36
Also, start launches a new application - it does not have any printing capabilities. –  Sathya Nov 11 '10 at 15:45
@Sathya: Thanks. I'm not surprised that cygstart has more capabilities than start, but I thought there was a way to trigger a print action from cmd (the print action invokes the application registered in the registry, telling it to print rather than open for editing). Do you happen to know if there is a way to print in cmd (print doesn't seem to be it either)? –  Gilles Nov 11 '10 at 15:55
@Gilles - one way is to copy the pdf files to the printer, if it's configured as a (network ) share - copy *.pdf \\printer\name. For batch processing cmd has a for command, but I'm stuck at how to make it perform multiple commands –  Sathya Nov 11 '10 at 15:59
@Sathya: I think something like for %x in (*.pdf) do ( ; command1 ; command2 ; ) with newlines where I wrote ;. If you can make it work, please make it an answer. –  Gilles Nov 11 '10 at 16:13

If you really want to go the command line way, copy paste this in a batch file, and change the path and do add the full path to AcroRd32.exe

cd\path\to\pdf\files
for %%f in ("*.pdf") do AcroRd32.exe /t %%f "\\servername\printername" & ping localhost -n 6 >NUL


This will change the directory to the one containing PDF files, start Acrobat Reader in silent mode, print them, and wait for 5 seconds. Another alternative if the printer is shared is

cd\path\to\pdf\files
for %%f in ("*.pdf") do copy %%f "\\servername\printername" & ping localhost -n 6 >NUL
`

Which does the same, but in my past experience I haven't got good results with this approach - but it's because of the PDF files not having the fonts embedded in them.

-

A great batch printing application I use all the time is SilentPrint. You can find out more about it at http://www.silentprint.com. I hope you find it as useful as I have.

-
If you're associated with that product, please disclose your affiliation per the FAQ, otherwise your posts might be removed as promotional –  slhck Jul 26 '12 at 11:49