Printing a Text File from Command Prompt
Solution 1
Try this :
START /MIN NOTEPAD /P yourfile.txt
Solution 2
I'd try
copy /b yourfilename yourportname
where yourportname may be PRN:
or LPT1:
or whatever.
BIT CHEETAH
→ Follow BIT CHEETAH to keep your web-figure sexy :. :. :.
Updated on June 04, 2022Comments
-
BIT CHEETAH almost 2 years
Alright, this is outside my area of expertise but so here's what I'm trying to do:
→ I have a POS (Point of Sale) receipt printer. I have the drivers installed for it and can print a test page with it. I can also print from notepad++ (for example), although it leaves a lot of empty space. This printer is set as the default printer.
→ I want to be able to print a single line to the printer using some automated process in Windows. My initial thought was to have the line I wanted to print in a text file and then to use:
print C:\filename.txt
from Command Prompt. However, this results in
C:\filename.txt is currently being printed
but nothing is printed. I am unfamiliar with ESC/POS and do not understand where to incorporate those commands either. Basically, printing a txt file from Command Prompt is my first necessity though. Any help?
-
Niels Keurentjes about 11 yearsSince this is not a programming question, it is offtopic on Stack Overflow. You might want to try on superuser.com/?as=1, not sure it'll be ontopic there though.
-
BIT CHEETAH about 11 yearsI am programming a batch file and need this command to work for the batch file to work. I believe batch files are still considered programming.
-
BIT CHEETAH about 11 yearsAlso, someone may have a solution that involves Python of which I am more familiar, but the task seems capable of being done via a batch file.
-
-
Magoo about 11 yearsHaving said that though, it would be raw bytes delivered to the printer - noth through any drivers. That's the way I run POS or label printers. The text you'd need to deliver would need to be in accordance with that particular printer's individual Printer Control Language - and there's no standard. That's what the driver does - convert Windows-talk to the particular printer's PCL.
-
M-- almost 7 yearsWhat's the port name for AdobePDF printer? I tried googling it but couldn't get my hands on something.