Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am looking for a way to copy the file "test.txt" to my usb printer which connected via USB002 port. this file contains some code instructions which design my print page. The reference of the printer tells me to copy the txt file to the printer using the DOS command line. But I really do not have the experience or whatsoever to do that.

Is there anyone who can explain how I copy the file? I guess I need something like:

copy test.txt /A/D USB002/A

Thanks in advance
Posted
Updated 20-Apr-18 4:25am
v2

I thought that USB002 is your printer port. Sorry for the confusion. First you need to map your printer to any of avilable printer port. To do that follow the step as given below

1. Open the Printer Property Page.
2. Go to the share / sharing tab. Check the Share button and give the one printer share name, and click on ok.
3. Open the Command Prompt CMD
4. Excute the given command
5. net use lpt1: \\computername\printersharename /persistent:yes

Here you are actually directly the lpt1 printer port to your USB print.
/persistent:yes means to map every time you login so no need to run this command every time.

After doing so you can easily run the dos command.
COPY /B test.txt LPT1
 
Share this answer
 
Comments
Member 11409258 28-Jan-15 11:06am    
thanks for the information. but my problem is... printer prints only 1st line.
please help.
This command should work for it.
COPY /B test.txt USB002
 
Share this answer
 
Comments
pieterjann 26-Sep-12 2:53am    
This places a file named usb002 on my desktop (test.txt is on my desktop too).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900