使用批处理文件打印ZPL文件 [英] Printing ZPL file using Batch File Issue

查看:163
本文介绍了使用批处理文件打印ZPL文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们为运输软件运行NetSuite,并使用Zebra ZP450打印机打印热敏标签.该软件会下载我分配给要与批处理文件一起运行的.zpl文件,请在此处执行脚本:

We run NetSuite for our shipping software and use Zebra ZP450 printer to print the thermal label. The software downloads a .zpl file which I have assigned to run with a batch file, script here:

Net use LPT2: \\%ComputerName%\ZebraFedex

Copy %1 LPT2

Net use LPT2: /Delete

我已经在20台或更多台计算机上安装了此软件,而没有出现问题.但是最后两个将启动批处理文件,但不会打印.

I have installed this on probably 20 or more computers without an issue. But the last two will initiate the batch file but not print.

我能够在批处理文件上点击暂停,这是我得到的:

I was able to hit pause on the batch file and here is what I got:

C:\ users \ noah \ downloads \ net使用LPT2:\(计算机名)\ ZebraFedex

C:\users\noah\downloads\net use LPT2: \(ComputerName)\ZebraFedex

命令成功完成

C:\ Users \ Noah \ Downloads \ Copy LPT2

C:\Users\Noah\Downloads\Copy LPT2

系统找不到指定的文件.已复制0个文件

The system cannot find the file specified. 0 files copied

C:\ Users \ Noah \ Downloads>网络使用LPT2:/删除

C:\Users\Noah\Downloads>Net use LPT2: /Delete

我已经检查了文件关联,由于我在屏幕上看到命令提示符闪烁,因此这似乎是正确的.我不知道在这里...

I've checked my file association, which seems correct since I see the command prompt flash on the screen. I have no idea here...

在另一台计算机上成功工作

Working successfully on another computer

令人困惑的计算机问题

推荐答案

这是将文件传输到我尊敬的TLP2844的批处理:

Here's my batch to transfer file to my venerable TLP2844:

@ECHO OFF
SETLOCAL
FOR %%a IN (%*) DO (
 IF EXIST "%%a" (COPY /b "%%~a" \\%computername%\TLP2844
 ) ELSE (
  IF EXIST "%%a.txt" (
   COPY /b "%%~a.txt" \\%computername%\TLP2844
  ) else (
   ECHO Neither "%%a" nor "%%a.txt" appears to EXIST
  )
 )
)

我在USB003上安装了名为 TLP2844 的打印机作为 ZDesigner TLP 2844 设备.

where I have a printer called TLP2844 installed as a ZDesigner TLP 2844 device on USB003.

问题(如我在问题中包含的图形所示(节省了追逐链接的开销)显示,标签文件 C:\ users \ melan \ downloads \ UPSSHIPPINGLABEL1700448.zpl 是作为%1 (第一个参数)提供给批次.在问题安装中,没有将文件名(大概是 C:\ users \ Noah \ downloads \ UPSSHIPPINGLABEL ???????.zpl )作为%1 .

The problem, as shown by the graphics I've included in your question (saves running off chasing links) is that the label file C:\users\melan\downloads\UPSSHIPPINGLABEL1700448.zpl is being provided to the batch as %1 (first parameter). On the problem installation, no filename (presumably C:\users\Noah\downloads\UPSSHIPPINGLABEL???????.zpl is being provided to the batch as %1.

因此,这不是批处理问题,而是 Netsuite 的问题.

Therefore it's not a batch problem, but a problem with Netsuite.

从您的.pdf,第26页:

From your .pdf, on page 26 :

要在Windows PC上安装热敏打印机驱动程序,请执行以下操作:...5.在共享名称字段中,输入打印机的名称.例如, LP 2844 .打印机名称不能包含空格.

To install a thermal printer driver on a Windows PC: ... 5. In the Share Name field, enter the name of the printer. For example, LP 2844. The printer name cannot contain spaces.

因此,您被告知打印机名称不能包含空格,但是示例打印机名称包含一个空格....非常好!(显示我对产品的信心水平,但实际上与问题没有直接关系):(

So you're told the printer name cannot contain spaces, but the example printer name contains a space....Excellent! (shows my level of confidence in the product, but not actually directly relevant to the problem) :(

我个人将您的批处理文件更改为

Personally, I'd change your batch file to

Copy %1 \\%ComputerName%\ZebraFedex

也许您可以在解决 Netsuite 无法将文件名传递到批次的问题后尝试尝试.可能是为了在有问题的计算机上生成 .pdf (这是一个疯狂的猜测)

Perhaps you'd try that after fixing the problem where Netsuite fails to deliver the filename to the batch. Perhaps it's set up to produce .pdfs on the computer in question (That's a wild guess)

回复:

请将您的批处理文件(暂时出于测试目的)更改为此:

Please change your batch file (temporarily for test purposes) to this:

Echo File to print : "%1"

Net use LPT2: \\%ComputerName%\ZebraFedex

Copy %1 LPT2

Net use LPT2: /Delete

PAUSE

它将把 Netsuite 提供的文件名报告到控制台窗口上的批处理文件,然后在批处理结束时保持窗口打开,直到打开的窗口收到击键为止.

which will report the filename supplied by Netsuite to the batch file on the console window, then keep the window open at the end of the batch until the open window receives a keystroke.

请报告两个正在工作"的结果和越野车"安装.

Please report results for both a "working" and a "buggy" installation.

这篇关于使用批处理文件打印ZPL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆