General discussion

Locked

Printing in Command Prompt

By f-1548911 ·
Hi, Anyone know how I can print the text in a command prompt using print, lpr or etc... commands without doing any print screen or cut and paste option?

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Printing in Command Prompt

by Joseph Moore In reply to Printing in Command Promp ...

Map you LPT1 port to a printer, then whenever you do a command prompt command that generates screen text, just add the >LPT1.
For example to map the LPT1 port to a printer:
NET USE LPT1 \\SERVER\SHAREDPRINTER /persistent:yes

The above maps the port to a printer and makes the mapping persistent, so it maps again the next time you log on.

Then, do this:
c:\winnt>dir >LPT1

That will redirect the screen text to the LPT1 port, which will print it to the printer you mapped to.

Or you can just redirect the screen text to a file, and print the file out later:
c:\winnt>dir >printfile.txt

All directories are just an example. Works from any directory, including mapped network shares.

Hope this helps.

Collapse -

Printing in Command Prompt

by f-1548911 In reply to Printing in Command Promp ...

Poster rated this answer

Collapse -

Printing in Command Prompt

by Frobo In reply to Printing in Command Promp ...

Hi,
mention anwser 1 and copy the file you want to printed out to the lpt port:
copy %winbootdir%\system32\repl\import\scripts\login.cmd ltp1:


regards


Frobo

Collapse -

Printing in Command Prompt

by f-1548911 In reply to Printing in Command Promp ...

Poster rated this answer

Collapse -

Printing in Command Prompt

by maz1980 In reply to Printing in Command Promp ...

I usually use this command:

type <file.name> > lpt1

If you have more then one printers, maybe you should use other than lpt1, maybe lpt2 or lpt3. Check your printers configuration.

If you want to print non-text file, you should print the file to a file for the appropriate printer on the appropriate application, example MS Word for doc file. Select "print to file" option on the application to make prn file, the file which will you send to the printer.

Note, not all printers can work with this method of printing, I have failed to this to a lower-end Canon printer.

Collapse -

Printing in Command Prompt

by f-1548911 In reply to Printing in Command Promp ...

Poster rated this answer

Collapse -

Printing in Command Prompt

by f-1548911 In reply to Printing in Command Promp ...

This question was closed by the author

Back to Windows Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums