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.
This command prints the label file named product1.qdf.
Number of Labels to Print (/C=)
The /C= command specifies the number of unique labels to print.
This command prints 50 labels using the file shipto.qdf.
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.
This example starts printing with the third label position.
Number of Pages to Print (/P=)
The /P= command specifies how many pages should be printed. The value must be numeric.
This command prints 25 pages of the label file customer.qdf.
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.
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.
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.
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.
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
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:
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.
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.
This example prints send.qdf while replacing the attached database named customer1 with the database file cust2.dbf.
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.
This example prints the label control.qdf, produces three duplicate labels for each record, and skips the first 15 database records.
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.
| Command | Behavior |
|---|---|
| /Z=1 | Checks whether attached databases have changed. If changes are detected, LMWPRINT automatically reanalyzes the database. No user interface is displayed. |
| /Z=2 | Does not check for database changes and does not perform any database reanalysis. |
| /Z=3 | Always 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.
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.
This example prints the label zlabel.qdf to the printer connected to the LPT1: port.
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:
| Command | Port Type | Example |
|---|---|---|
| /OS=COMportname | Serial Port | /OS=COM1: |
| /OP=LPTportname | Parallel Port | /OP=LPT1: |
| /ON=\\servername\printername | UNC Network Printer | /ON=\\HAL9000\EasyCoderF4 |
| /OI=TCP/IPaddress | TCP/IP Printer | /OI=192.168.10.143 |
| /OI=TCP/IPaddress:port\ipp\queuename | TCP/IP Printer with Port and IPP Queue | Specify the printer IP address, port number, and IPP queue name. |
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.
