Wednesday, December 19, 2018

Designate a Dedicated Thermal Printer Per Shipping Carrier on a Single Computer

NetSuite's solution in printing integrated shipping labels (. EPL2) is through the use of a batch file. The help guide provides this syntax for the batch file: print /d:\\Server\PrinterName %1. NetSuite uses this batch file, which we call label. bat, to send the EPL2 labels to a printer. However, one inherent limitation of using the batch file is that it only prints to one thermal printer

Right now, users do not have the ability to designate a dedicated thermal printer per carrier on a single PC because the steps we are accustomed to only utilize one batch file.

The solution is to add a condition in the batch file to assign a specific printer to a carrier label. Using 'IF' statements we can conditionally perform a command, allowing users to send a file to a different printers. Since each label file distinctly starts with the name of the shipping carrier, we can use the first three characters of the filename as the basis of the condition.

Here are the steps:

1. Edit your label.bat file in a notepad.
2. Replace it with the following syntax below:

@echo off


@echo %~nx1


@set filename=%~nx1

@set str=%filename:~0,3%


@echo %str%


@if /i %str% equ ups PRINT /d:\\computername\printer1 %1 

@if /i %str% equ fed PRINT /d:\\computername\printer2 %1

@if /i %str% equ usp PRINT /d:\\computername\printer3 %1



3. Save

- Each of the IF statement above looks the first three characters of the label file to determine the name of the carrier.
- Each carrier will have its own corresponding printer. Remove the condition line from the syntax that corresponds to the carrier that you are not integrated with.
- Replace "computername" with the full computer name and "printer1" with the actual share printer name. Follow the same steps with the rest of the printers.


No comments:

Post a Comment