I am working as a VB6 programmer.
To print a .txt file through DOS mode i am using a batch file with code
copy mydoc.txt to prn:
But it is not working in USB port printers.
Plz send me the VB6 code for printing a text file using USB printers.
Google for DOS PRINT USB, and you'll find some utilities that do this.
Or, you can include some commands in your batch file.
First, get the device name:
In a DOS window, type NET VIEW ComputerName (or use 127.0.0.1)
Once you know the printer share name, you use it in a batch file.
NET USE lpt1: \\ComputerName\ShareName /Persistent:Y
This captures the print queue to the shared printer.
You must also go into Printer Properties/Advanced/Print Processor and set it to TEXT
Your copy, print and other commands will work.
Creating a batch file
MS-DOS users
Microsoft Windows and other users
MS-DOS users
To create a basic batch file in MS-DOS, follow the below steps that give you an example of how to create a basic batch file.
1. Save your text file (.txt).
2. On the command prompt navigate to that directory
3.Type "Lpr -S 192.168.1.200 -P lp text.txt"
Substitute 192.168.1.200 for your copier's ip
Substitute text.txt to filename.
Or you can: to print from MS-DOS apps.
1. Share the printer on a networked windows computer. Make sure you make the name MS-DOS compatible.
2. At a DOS prompt, type the following command:
"net use lpt1: \\servername\printer_share/persistent:yes"
NOTE Servername=computer name
printer_share=printers share name
1,669 views
Usually answered in minutes!
Problem: USB printing through DOS mode
posted by naga_rajan06 on 07/12/2008
I am working as a VB6 programmer.
To print a .txt file through DOS mode i am using a batch file with code
copy mydoc.txt to prn:
But it is not working in USB port printers.
Plz send me the VB6 code for printing a text file using USB printers.
I am working as a VB6 programmer. To print a .txt file through DOS mode i am using a batch file with code copy mydoc.txt to prn: But it is not working in USB port printers. Plz send me the VB6 code for printing a text file using USB printers.
×