Command line

LabeljoyNew version

Labeljoy can print and export without opening its window: from a script, a scheduled task, or another program that needs labels. You type a command in a command prompt, and the document is printed or exported with the settings saved in it - or with the ones you change for that run.

Printing takes the document and nothing else:

LabeljoyX /p "C:\Labels\Shipping.ljx"

Exporting also needs what to export, /em, and where, /et:

LabeljoyX /e "C:\Labels\Shipping.ljx" /em=0 /et=C:\Out\Shipping.pdf

How a command is written
The documentRight after /p or /e, in quotes.
A switchA slash, two letters, an equals sign and the value: /cp=2 prints two copies. The order doesn't matter.
ValuesWithout quotes, even with spaces in them: /pn=Office printer 2. Quotes work too. A slash in a value is fine, but not at the start of a word: that starts the next switch.
Yes or no1 is no, 2 is yes.

The installer makes LabeljoyX work in any command prompt. Type LabeljoyX /? for a short summary of the switches.

Printing
/pnThe printer, by its exact name as Windows shows it.
/cpCopies, from 1.
/ctCollate: 1 no, 2 yes.
/bw1 grayscale, 2 color.
/ds1 one sided, 2 both sides flipped on the long edge, 3 both sides flipped on the short edge.
Exporting
/emWhat to export: 0 pages, 1 a label set, 2 an element. Required.
/etThe file to write, in a folder that already exists. Required. Its extension is replaced by the format's.
/efThe format: pdf, png, jpg, webp, gif, tif or bmp. See File formats.
/dpThe resolution, from 72 to 1200 dpi.
/si, /eiWhich label set, and which element of it, counting from 1.
/fnA field of the data source to name the files after.
/spOne PDF per page or label: 1 no, 2 yes.
/of, /odOpen the file, or its folder, when it's done: 1 no, 2 yes.
Both
/rgPages: all, or the first and the last, as in /rg=2:5.
/lgLabels, the same way: /lg=1:40.
/lmLabel placement, for a label range: 0 start from first available position, 1 keep original start position, 2 full pages. See Print start position.
/aaAuto-advance the page or label range after the run: 1 no, 2 yes.
/fpThe start position on the first sheet, row first: /fp=3:2 is row 3, column 2. all is the top left.
/upUpdate the start position after the run: 1 no, 2 yes.
/roRendering order: 1 across and then down, 2 down and then across.
/pwThe password, for a document protected against printing and exporting - see below.
/laThe language of the run's messages, by a two-letter code such as en, it, de, fr or es.

Switches change that run only: the document keeps its own settings. After the run Labeljoy saves the document only to keep what the run moved on - the start position, an auto-advanced range, counters - so the next run carries on from there. A print without /rg or /lg uses the document's own range; an export without them exports all pages.

What you see. In a command prompt, Labeljoy writes what it's doing, and pressing a key cancels the job. When it ends, the exit code says how it went: 0 if it all worked, 1 if anything went wrong or was canceled - so a script can check. A mistake in the command, such as a switch that doesn't exist or a value it can't use, stops the run before anything is printed, with a message saying which switch is wrong.

Questions. A run asks what printing from the window would ask: the password, how many labels, the values the labels ask for, and the two warnings of the Print panel, unless you've hidden them. With nobody at the keyboard - a scheduled task, input from a file - every question counts as no, the run stops, and the exit code is 1.

The password. /pw takes the password's SHA-1 fingerprint, not the password itself, so it never sits in a script as plain text. In PowerShell, this prints the fingerprint of a password:

-join ([Security.Cryptography.SHA1]::Create().ComputeHash([Text.Encoding]::UTF8.GetBytes("your password")) | % { $_.ToString("x2") })

Want the command written for you? Ask Joy, the AI assistant: "give me a command line that prints this document on the office printer, two copies". It writes the line from the document you have open; it never puts a password in it.

A print started from the Print with Labeljoy menu of File Explorer, or from a print shortcut saved from the Save panel, works the same way. With no command prompt to write in, it shows a small window with the progress and any questions. Either way, a run is separate from Labeljoy's window: you can keep working in it while a script prints.