Command line
Print without a window using bpcli.exe, for scripts and scheduled tasks.
1Basics
The ZIP has two programs: bpcli.exe is a console program with no window that prints its results as JSON; BatchPrint.exe takes the same arguments, opens the main window and adds the files to the list.
bpcli "D:\Inbox" --printer "Finance HP M404" --set Duplex=LongEdge --set Copies=2bpcli a.pdf b.docx --printer "Microsoft Print to PDF" --output-dir "D:\PDF-out"bpcli --list "D:\Monthly\statements.bplist" --printer "Office A" --estimateBatchPrint.exe --list "D:\Monthly\statements.bplist" --printer "Office A" --print --exit2Options
| Option | What it does |
|---|---|
files or folders … | Files to print; folders are scanned with their subfolders |
--list <file> | Read a .bplist, .txt or .csv list |
--printer "<name>" | Printer name as shown in Devices and Printers (required for bpcli) |
--settings <file> | Use an exported .bpsettings file |
--set 名称=值 | Override one setting; repeat as needed, see below |
--output-dir <folder> | Output folder for virtual printers |
--estimate | Estimate only; nothing is printed |
--report <file.csv> | Write the results to a CSV report |
--lang <code> | auto zh-CN zh-TW en ja ko de fr es ru |
--print / --exit | BatchPrint.exe only: print on start / exit when done |
3--set keys
Names are case-insensitive and match the fields in a .bpsettings file. Load a set with --settings first, then change single values with --set.
| Key | Values |
|---|---|
Copies | 1–999 |
Collation | ByDocument ByPage AsPrinter |
ListRepeat | 1–99 |
ColorMode | AsPrinter Color Grayscale |
Orientation | AsDocument Portrait Landscape |
Duplex | AsPrinter Simplex LongEdge ShortEdge |
PagesPerSheet | 1 2 4 6 9 16 |
PageRange | 1-3,5,last |
PaperSize | AsDocument A3 A4 A5 B5 Letter Legal |
Scale | Fit Shrink Fill ActualSize |
CoverPage / ReportPage / Reverse / SingleJob | true false |
CoverTemplate | FileNameWithMark FileName FileNameNoExt FolderName FolderPath Blank Details |
JobNameTemplate / OutputNameTemplate | Text with macros |
Dpi | 150 200 300 600 |
Watermark.Enabled / Watermark.Text / Watermark.Opacity / Watermark.Angle | Nested settings use a dot |
PostAction / PostFolder | None Delete Move Copy |
4Exit codes
| Code | Meaning |
|---|---|
| 0 | Everything printed |
| 1 | Some files failed (the rest printed) |
| 2 | Bad arguments, printer not found or nothing to print; nothing was printed |
bpcli --list D:\jobs\daily.bplist --printer "Office A" --report D:\logs\daily.csv
if errorlevel 2 echo Nothing printed & exit /b 2
if errorlevel 1 echo Some files failed, see daily.csv5Scheduled tasks
- Prepare the list and settingsSet things up in the desktop app and export a
.bplistand a.bpsettings. - Run it once by handCheck with
--estimate, then print to Microsoft Print to PDF to confirm the result. - Create the taskIn Task Scheduler run
bpcli.exewith the same arguments plus--reportto keep a record. For Office files, run the task under an account that has signed in and opened Office before.