Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Commands DOS
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 25-Sep-12 5:45am
Edited 25-Sep-12 5:46am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This command should work for it.
COPY /B test.txt USB002
pieterjann at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 420
1 OriginalGriff 210
2 Kornfeld Eliyahu Peter 210
3 DamithSL 210
4 mukesh mourya 85
0 OriginalGriff 7,215
1 DamithSL 5,199
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,757
4 Kornfeld Eliyahu Peter 4,514

Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 26 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100