2

I would like to silent print a PDF file multiple times. I don't really mind what implementation is used, but due to being in a corporate environment I cannot easily install unsupported software :(.

I am currently using the following VBscript but could switch to any other implementation:

    TargetFolder = "<path to folder>" 
 Set objShell = CreateObject("Shell.Application") 
 Set objFolder = objShell.Namespace(TargetFolder) 
 Set colItems = objFolder.Items 
 For Each objItem In colItems 
 For i = 1 To 13     
 objItem.InvokeVerbEx ("Print")
 Next 
 Next

This spools the job 13 times though. Is there a way to do this as a single job?

I also saw a suggestion for printing using adobe reader that looked like this:

AcroRd32.exe /t <file.pdf> <printer_name> <printer_driver> <printer_port>

But I couldn't find any reference material for passing the number of copies as a parameter.

Shaun-Adam
  • 76
  • 8
  • Hint: `For i = 1 To 13`, `Next`. –  Aug 21 '17 at 13:01
  • The objective is to get the PDF to print 13 times. What I am getting at is that this loop sends the document to the printer 13 separate times (print one, receive it again, print again....repeat). I would like it to send it once and print it 13 times. – Shaun-Adam Aug 22 '17 at 06:07
  • And, **please read tag description! `BATCH-FILE` DOES NOT mean processing multiple files!** –  Aug 22 '17 at 10:00
  • I'm familiar with what a batch-file is. This is one. It is a set of commands to be executed in a windows environment saved into a single script. While this batch file supports the batch printing of all files in the folder, this has no bearing on the question at hand and the tag is appropriate. – Shaun-Adam Aug 22 '17 at 18:45
  • The 3rd sentence is correct. But isn't this a VBScript. The `AcroRd32.exe` is just a command, and it can run from both **command prompt** and **batch file**. –  Aug 22 '17 at 23:38
  • And... I wonder... Where is the so-called "Batch File"? –  Aug 22 '17 at 23:41

1 Answers1

1

I just found this questions which is essentially the same:

Programatically print multiple copies from command line

It appears that looping through and sending the file multiple times is the only solution without additional software.

Shaun-Adam
  • 76
  • 8