Batch File Printing

8

4

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.

chrispt

Posted 2010-11-11T14:13:29.953

Reputation: 223

Answers

4

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.

Joe Taylor

Posted 2010-11-11T14:13:29.953

Reputation: 11 533

wow - DarkStorm's batch print handler is nice. – Sathyajith Bhat – 2010-11-11T15:43:58.220

Downloading now. All the scripting is nice, but I would rather not go that route. Going to test DarkStorm. – chrispt – 2010-11-11T19:06:45.973

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 – 2010-11-11T19:15:14.260

3

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).

Gilles 'SO- stop being evil'

Posted 2010-11-11T14:13:29.953

Reputation: 58 319

cmd has an equivalent of sleep --> crude replacement would be `ping localhost -n 6 >NUL – Sathyajith Bhat – 2010-11-11T15:36:58.483

Also, start launches a new application - it does not have any printing capabilities. – Sathyajith Bhat – 2010-11-11T15:45:25.560

@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 'SO- stop being evil' – 2010-11-11T15:55:07.543

@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 – Sathyajith Bhat – 2010-11-11T15:59:57.690

@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 'SO- stop being evil' – 2010-11-11T16:13:16.160

@Gilles - it's actually ampersand - & - I have posted an answer. – Sathyajith Bhat – 2010-11-11T16:20:11.780

2

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.

Sathyajith Bhat

Posted 2010-11-11T14:13:29.953

Reputation: 58 436

0

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.

Jimmi Kin

Posted 2010-11-11T14:13:29.953

Reputation: 1

1If you're associated with that product, please disclose your affiliation per the [FAQ], otherwise your posts might be removed as promotional – slhck – 2012-07-26T11:49:49.963