【问题标题】:Print is not working while executing a batch file to print a file using network printer执行批处理文件以使用网络打印机打印文件时打印不起作用
【发布时间】:2015-11-26 05:59:01
【问题描述】:

批处理文件包含以下代码。

type "E:\Test\DotMatrix Print\DosPrint\PrintData.prn">LPT1  
del "E:\Test\DotMatrix Print\DosPrint\PrintData.prn"

【问题讨论】:

  • 您的打印机有网络路径吗?打印prn 文件的一种方法是Copy filename.prn \\computername\printersharename

标签: windows batch-file networking printing command-prompt


【解决方案1】:

Type 用于显示文件的内容。通过批处理打印文件的命令是print。如果您不指定设备,文件将由您的默认打印机打印。

print /?
Prints a text file.

PRINT [/D:device] [[drive:][path]filename[...]]

   /D:device   Specifies a print device.

你的代码应该是print "E:\Test\DotMatrix Print\DosPrint\PrintData.prn"

【讨论】:

  • print 适用于过时的文本打印机。我认为这行不通。
  • 好吧,你肯定不用type :)
  • @SomethingDark 我想在映射到 LPT1 端口的点阵打印机中打印出来。我已经搜索并得到了将其转换为 ascii-usa 格式的答案。在我转换后.it工作。但 2 天后又没有工作。还有其他选择吗??
猜你喜欢
  • 2021-04-17
  • 1970-01-01
  • 2011-04-12
  • 2013-01-22
  • 1970-01-01
  • 1970-01-01
  • 2023-03-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多