Views:

Product: LABEL MATRIX
Version: 2022 and Earlier

This article explains the available LMWPRINT command-line switches used to automate printing in LABEL MATRIX. Each command includes a description, supported syntax, and example usage.

You can also find the Command Line Printing document in the software by going into Help > Help Topics > Command Line Printing > LMWPRINT Commands.

NOTE: Depending on your LABEL MATRIX edition, some command-line functionality may not be available.


Available LMWPRINT Commands

Label Setup Commands

  • File Name of Label to Print (/L=)
  • Number of Labels to Print (/C=)
  • Start On Label (/R=)
  • Number of Pages to Print (/P=)
  • Number of Duplicate Labels (/D=)
  • Bypass Program Password (/E=)
  • Bypass Label Password (/LP=)
  • Log Error Messages (/G= or /G)
  • Lock File (/F= or /FL=)

Database Commands

  • Replace Data File (/File=)
  • Number of Records to Skip (/S=)
  • Control Database Reanalyzing (/Z=)

Print Job Commands

  • Redirect Printed Output (/O)
  • Specify Printer Name (/X)
  • Suppress Print Status Dialog (/N)
  • Wait for Next Print Job (/W)
  • Run Separate Instance (/Y)
  • Minimize LMWPRINT (/M)
  • Close LMWPRINT (/Q)
  • Using LMWPRINT to Run AutoPrint
  • Using LMWPRINT to Control the Write Data Function

Label Setup Commands

File Name of Label to Print (/L=)

Use the /L= command to specify which label file LMWPRINT should open and print. Enter the complete label file name. If you omit the file extension, the .QDF extension is automatically appended.

LMWPRINT /L=product1.qdf

This command prints the label file named product1.qdf.

When to use: Use this command whenever you want to specify the label file to print from the command line.

Number of Labels to Print (/C=)

The /C= command specifies the number of unique labels to print.

LMWPRINT /L=shipto.qdf /C=50

This command prints 50 labels using the file shipto.qdf.

When to use: Specify the total number of labels that should be printed.

Start On Label (/R=)

Use the /R= command to specify which label position to begin printing on when using multiple labels per page. The value must be between 1 and the total number of labels on the page.

The starting position depends on the label direction configured on the Label Properties > Multiple tab.

LMWPRINT /L=shipto.qdf /R=3

This example starts printing with the third label position.

Tip: Verify the label direction in your template before choosing the starting label number.

Number of Pages to Print (/P=)

The /P= command specifies how many pages should be printed. The value must be numeric.

LMWPRINT /L=customer.qdf /P=25

This command prints 25 pages of the label file customer.qdf.

When to use: Use this command when you want to limit the number of pages printed.

Number of Duplicate Labels (/D=)

The /D= command specifies how many duplicate labels to print. This overrides any Constant duplicate settings saved in the label, but it does not override duplicates generated from database or keyboard data sources.

LMWPRINT /L=office.qdf /C=50 /D=2

This command prints 50 labels and produces two copies of each label for a total of 100 printed labels.

Bypass Program Password (/E=)

If LABEL MATRIX security requires users to enter a username and password before using the software, the /E= command allows LMWPRINT to authenticate automatically. Without this command, a login dialog appears during automated printing.

LMWPRINT /L=ex2.qdf /E=PSmith,golfball

This example opens ex2.qdf, logs in using the specified username and password, and prints automatically.

Bypass Label Password (/LP=)

Use the /LP= command when an individual label design is password protected. Without this switch, LMWPRINT prompts for the password before opening the label.

LMWPRINT /L=ex2.qdf /LP=football

This command automatically supplies the password for the protected label.

Log Error Messages (/G= or /G)

Use the /G= command to write error messages to a log file instead of displaying dialog boxes. Using /G without a filename suppresses error dialogs entirely.

LMWPRINT /L=quantity.qdf /C=75 /G=logfile.txt

This example prints 75 labels and records any errors in logfile.txt.

Lock File (/F= or /FL=)

NOTE: The /F= command cannot be used with AutoPrint.

The /F= command creates a temporary lock file while a print job is running. Front-end applications can monitor this file to determine when printing has completed.

The /FL= command performs the same function but also keeps the file open until the print job completes or fails, allowing external applications to detect completion more reliably.

Implementing the Lock File Command

Step 1. Create a temporary lock file from your front-end application.
Step 2. Configure the application to monitor the lock file. Once the file is deleted, the print job has completed.
Step 3. Add the /F= switch to your LMWPRINT command or batch file.
LMWPRINT /L=ex2.qdf /F=C:\lock.txt

This example prints ex2.qdf while using C:\lock.txt as the lock file.

NOTE: TEKLYNX cannot provide support for custom front-end applications or application programming.


Database Commands

The following command-line switches control how LMWPRINT interacts with databases attached to a label during printing. These commands allow you to replace database files, skip records, and control database reanalysis.

Replace Data File (/File=)

The /File= command replaces a database attached to the label with another database that uses the same format.

This command requires two parameters:

Parameter 1: internalName
The internal database name assigned within LABEL MATRIX. This is not the database file name. You can find this name in the Database tab of the Label Properties dialog.
Parameter 2: path\datafileName
The replacement database file. It must use the same database format as the original attached database.

Always specify the label file using the /L= command when replacing a database.

LMWPRINT /L=send.qdf /File=customer1,cust2.dbf

This example prints send.qdf while replacing the attached database named customer1 with the database file cust2.dbf.

When to use: Use this command when you need to print the same label using a different database without modifying the label design.

Number of Records to Skip (/S=)

The /S= command skips a specified number of records when printing from a sequential database.

This is useful when a print job is interrupted and you need to resume printing without reprinting records that have already been processed.

The value supplied must be a numeric value.

LMWPRINT /L=control.qdf /D=3 /S=15

This example prints the label control.qdf, produces three duplicate labels for each record, and skips the first 15 database records.

Common use case: Resume a partially completed print job by skipping records that have already printed.

Control Database Reanalyzing (/Z=)

The /Z= command controls how LMWPRINT handles database structure changes before printing.

If no /Z= command is supplied, LMWPRINT checks for database structure changes and prompts the user to decide whether the database should be reanalyzed.

CommandBehavior
/Z=1Checks whether attached databases have changed. If changes are detected, LMWPRINT automatically reanalyzes the database. No user interface is displayed.
/Z=2Does not check for database changes and does not perform any database reanalysis.
/Z=3Always reanalyzes every attached database regardless of whether any changes have occurred. A user interface is displayed during the process.

NOTE: Using any value other than /Z=1, /Z=2, or /Z=3 (including using /Z without a value) results in a command-line parsing error.

Recommendation: Use /Z=1 for most automated printing scenarios because it automatically updates changed databases without requiring user interaction.

Print Job Commands

The following commands control how LMWPRINT sends print jobs to printers and printer ports. These commands allow you to redirect output to a different printer or communication port without modifying the original label design.

Redirect Printed Output to a Port or Printer Path (/O)

Printing Using Standard Serial or Parallel Ports

The /O command redirects printed output to a different printer port than the one configured in the label design.

The printer connected to the new port must use the same printer model and driver as the printer configured when the label was designed.

This command is useful when multiple printers of the same model are available and you want to choose which printer receives the print job at runtime.

LMWPRINT /L=zlabel.qdf /O=LPT1:

This example prints the label zlabel.qdf to the printer connected to the LPT1: port.

Common use case: Redirect a print job to another identical printer without changing the label design.

Printing Using TCP/IP or UNC Ports

When printing to TCP/IP or UNC network printers, the /O command requires an additional letter to identify the type of port being used.

Use the following syntax for each supported connection type:

CommandPort TypeExample
/OS=COMportnameSerial Port/OS=COM1:
/OP=LPTportnameParallel Port/OP=LPT1:
/ON=\\servername\printernameUNC Network Printer/ON=\\HAL9000\EasyCoderF4
/OI=TCP/IPaddressTCP/IP Printer/OI=192.168.10.143
/OI=TCP/IPaddress:port\ipp\queuenameTCP/IP Printer with Port and IPP QueueSpecify the printer IP address, port number, and IPP queue name.
Recommendation: Use the appropriate command prefix (/OS, /OP, /ON, or /OI) based on the type of printer connection you are using.

Note: The printer specified with the /O command should use the same printer driver and printer model as the one configured in the original label design to ensure correct printing.