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.
/d
specifies a device (not a printer name) wheredevice
is either a local printer (LPTx
,COMx
) or a network printer by its sharename (\\servername\print_share
). See Print - Windows CMD - SS64.com