2

I try to print from the command line specifying only the name of the printer:

C:\> print file.txt /D:epson

The following message is displayed:

The epson device can not be initialized

I require that it can be printed only by specifying the name of the printer, or that it detects the printer by default.

It's possible?

Some comment

2
  • 2
    Not possible. /d specifies a device (not a printer name) where device is either a local printer (LPTx, COMx) or a network printer by its sharename (\\servername\print_share). See Print - Windows CMD - SS64.com
    – DavidPostill
    Feb 19, 2019 at 20:27
  • How would you specify local printer (LPTx, COMx), without sharing the printer ?: I have a dot matrix printer connected by USB , thanks for your comments.
    – amoralesu
    Feb 19, 2019 at 20:43

1 Answer 1

1

The method you suggest does not work under Windows. Nor can you send the file to a USB port.

Before I explain how to achieve what you want, I'll start by assuming the printer actually understands plain text. As your comment says it's a dot matrix printer, it probably does. However, most low-cost USB inkjet and laser printers do not, so in that case the rest of my answer is irrelevant.

Start by sharing the printer on the PC that it is connected to. Do this even if only that PC will ever need to print to it. Make a note of the share-name. Also note the PC's host-name.

Now issue the following command from a DOS prompt:

NET USE LPT1: \host-name\printer-share-name /persistent:yes

After this you should be able to print your file by typing:

PRINT /D:LPT1 file.txt

You can also use COPY, TYPE and any other command that lets you send a file to a device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .