Sunteți pe pagina 1din 3

KemTec technical information file PR100

Windows 2000 and XP

Printing from the DOS prompt using a USB Printer


Sometimes it is useful to be able to print from the DOS prompt or from a program running in command mode. If you have a printer with only a USB connection (no LPT1 port) you cannot do this as there are no USB DOS commands. However there is an easy way to overcome this limitation if you are using Windows 2000 or XP. This is achieved by treating your USB printer as a network printer and setting it up as a virtual centronics printer by assigning it to an unused LPT port.

How to do it:
If your Windows 2000/XP computer is set up as a networked machine proceed below. If it is not set up as part of a network go to (3) to install the Microsoft Loopback Adapter. 1) If not already assigned, set the printer as a shared printer with an appropriate network resource name eg. EpsonR300. Start| Control Panel | Printers and Faxes| Right click your USB printer icon and select Sharing See figure 1. Click the Share this printer radio button and enter a share name. The share name can be alphanumeric (the first letter however must be an alphabetic character). See figure 2.

Figure 1

Figure 2

To see your shared devices list, go to the Command prompt | Start| Run | then type cmd and in the command window type net view \\your computer name If you dont know your computer name go to the System menu, | Start | Control Panel |System | and select the Computer Name tab.

Kemtec.com

IT Distance Learning Courses

2004

KemTec technical information file PR100

Windows 2000 and XP

2) Now using an unused centronics port ie. LPT1 or LPT2: type the following in the command window to set your USB printer port as a virtual centronics port: net use LPT2 \\ your computer name\ your USB printer name /Persistant:Yes. Note: Your computer name and your USB printer name are the resource names of the USB printer assigned/listed in step 1. The /Persistent:Yes portion of the command ensures that the link is re-established when the system is rebooted. To check that the link is in place , type net view \\your computer name as before. To test the link type dir >lpt2 at the command prompt. This prints out a listing of the current directory You will probably have to do this several times if the directory listing is short to allow the page to emerge from the printer. To delete the link type net use LPT2 /Delete

IF YOUR PC IS NOT ALREADY SET UP AS A NEWORK MACHINE 3) If your computer is not set up as a network printer you can easily install the Microsoft Loopback Adapter to allow shared network devices. To do this go to the add hardware wizard i.e. click on Start| Control Panel | Add Hardware| Select Yes, I have already connected the hardware Figure3. Click Next and in the installed hardware devices list select Add a new hardware device. Then click Next. Figure 4.

Figure 3

Figure 4

Kemtec.com

IT Distance Learning Courses

2004

KemTec technical information file PR100

Windows 2000 and XP

Choose Install the hardware that I manually select from a list (Advanced). Then click Next Figure 5. From the list of hardware devices choose Network adapters Figure 6.

Figure 5

Figure 6

In the network adapters list choose Microsoft in the left hand window and Microsoft Loopback Adapter in the right hand window. Then click NextFigure 7.

Figure 7 The Loopback Adapter is now installed. Go back to (1) to continue the USB printer link.

Kemtec.com

IT Distance Learning Courses

2004

S-ar putea să vă placă și