# Dos Print command



## DudleyDoRite

what is the command to print to a USB printer? I remember the old one to lpt1 
c:\print test.txt >lpt1

so what nell is the usb port???


----------



## MacFromOK

_____________________________________________
Well, I don't know about a USB printer,
but for LPT I use:

*copy test.txt prn*

This command should find the printer, wherever
it is. Another note though, some newer printer
drivers don't work that great from a DOS box.
So if ya can't get it to print, that might be
something else to check. 

Cheers, Mac


----------



## brushmaster1

Most newer printers have no DOS drivers, and I've yet to see a printer that will print to a USB port from DOS. You might try copying to PRN, but if that doesn't work, you're probably out of luck.

As a last resort, try contacting tech support for your printer.


----------



## mole

You can push an ascii text file to the default printer by doing something like this:

start /min notepad /P myfile.txt

Where myfile.txt can be any file that will open in notepad, it does not have to have a .txt extension. Works for Wordpad too if the file is big and you're using Win9x. If you don't use "start /min" this will still work, but the notepad executable will grab focus away from any batch you run this from and could stall the batch later, requiring a mouse click on the window to get it going.


----------



## DudleyDoRite

Holy Poop, dint think it was gonna be that complicated. Was just trying to test if the usb port to printer was working, Thanks guys for all the info. 

DDR


----------



## bolex

There is special program for this purpose. DOSPRN support printing from DOS on any kinds of printers include winprinters, USB-printers, network printers etc.

Also DOSPRN support landscape/portrait printing, text color manipulation, absolute positioning and many other features

http://www.dosprn.com


----------



## Rikku

Couldn't you just capture your USB Printer to a LPT port? Isn't that what that option is there for???

Then printing from DOS would work fine.


----------



## mole

Along the lines of what Mac posted above, in a command prompt you could then do:

copy myfile.txt lpt1

...or whatever lptx you happen to have the USB pointed to.


----------



## bassetman

It was my understanding that USB required Windows (or similar type OS) that is why a USB mouse or keyboard wouldn't work in DOS!


----------



## mole

The OP could be referring to a command line interface (command propmt, a.k.a. "DOS") window launched from the Windows OS. That would be assumed given what you said:



> ...USB required Windows (or similar type OS)...


For various reasons, a user may wish to access a given device such as a printer via such a command line interface, *.cmd or *.bat file.

mole


----------



## bassetman

Thanks Mole, that makes sense


----------



## Dtack

There's only one way I found to print to usb in DOS by capturing an LPT port. You first have to share the printer in windows. You then go to the command prompt and type
NET USE LPTx \\COMPUTER\PRINTER

where x is the lpt port, COMPUTER is your computer name and PRINTER is the shared name of your printer.

I hope this helps.


----------

