Question Locked

Printing text file on USB port.

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
I route my output from a VB6 Window Application for Check printing application through a text format. When I try to print this file through the USB port, I am unable to give a direct print. If I save to a file and print the same opening through notepad then i am getting the printout.Earlier i was having this printing application on LPT port. But now printer is in USB port the text is just shown in the printer printing list but it hangs out there. How to directly print a text file through a USB port in high speed draft format from a windows application? Can you kindly provide me the code inorder to print it on usb port,

2 replies

by Former member

For the kids out there, the Microsoft Loopback Adapter is basically a software based network adapter that simulates a live network. It was designed for this very purpose. Testing network functionality in the absense of a live network. Anybody out there remember the PWS on Win95? (that's personal webserver - and you could even do ASP on it) Packets basically travel up and down the TCP/IP stack through the adapter and get fed right back to you. So now, as far as Windows is concerned, the network is not only clocked in, but willing to work overtime if neccessary. Sweet.

So here, for your edification and reading enjoyment are step-by-step directions on making this work.

In order to print from DOS in an offline environment like the stores, you will need to do a couple of things.

1) Install the Microsoft Loopback Adapter

a) In Control Panel, double click on Add Hardware.

b) Click Next

c) When the scan finishes, select "Yes, I have already connected the hardware"

d) Click Next

e) Scroll to the bottom of the list and select "Add a new hardware device"
Click Next

f) Select "Install the hardware that I manually select from a list (Advanced)"

g) Click Next

h) Select "Network Adapters"

i) Click Next

j) Select "Microsoft" under the Manufacturer list.

k) Select "Microsoft Loopback Adapter" in the Network Adapter list.

l) Click Next

m) Click Next

n) Click Finish

2) Configure the Adapter

a) The loopback adapter is a virtual network adapter and can be configured the same as a regular network card.

b) Set the adapter to have a static IP address such as 192.168.1.1/ 255.255.255.0

3) Share the printer.

a) I recommend you use a share name that you will remember. I used ?Printer? in the new machines that are already deployed.

4) Capture the printer port.

a) NET USE LPT1: \\[Computer Name]\Printer /PERSISTENT:YES

Now, not that I like to encourage this type of behaviour, but if you have done the above and still can't get it to print, you may find some help through one of the articles located here.
Thanks to Dave
Just because he can. :)

Please post back if you have any more problems or questions.

This discussion is closed to new replies.