Redirect Printer Port to LPT3 for Remote Desktop Local Print
 

Sonora Communications, Inc.

  • Increase font size
  • Default font size
  • Decrease font size

Redirect Printer Port to LPT3 for Remote Desktop Local Print

E-mail Print PDF

Redirect Printer Port to LPT3 for Printing to Local Printer in Remote Desktop Session

Remote Desktop client CAN redirect printing to the local printer while controlling a host. 

http://support.microsoft.com/kb/312135

There are circumstances where this does not work. Direct to IP and Dot4 USB for example.

 http://support.microsoft.com/kb/302361

The above registry edit has worked but I have seen it fail. 

I have experienced a local printer that has an IP address as the port not displaying in the remote session.  However local printers that have a print server (\\localpc\hplj) as the port are available in the remote session.  I got around the "direct to IP address"  by redirecting the print job to LPT3 and then adding a printer and using LPT3 as the port.

The reason for using LPT3 instead of LPT1 is because on Windows XP if the LPT port you are trying to redirect is assigned (you have a parallel printer) it will require authentication complicating this procedure.  Chances are you do not have 3 parallel ports on your PC.

This procedure works for Remote Desktop sessions to Windows 2003 Terminal Services Servers and XP Professional with Remote Desktop enabled.  Not tested on Vista. 

Roadmap:

1. Make sure the EXACT same printer driver is on both Host and Remote
2. Share the printer on Remote
3.  Redirect printing on Remote to create a printer using LPT3
4. Create a batch file with the redirection and set it to run at startup

Printer Driver for Local Printer Must Be on Host

Under all circumstances the EXACT same driver for the printer local to the remote PC must be installed on the host PC.  The printer does not need to be installed but the driver must be available.  Sometimes the way to accomplish this with USB/Multi Function printers is to install the printer so the driver is available then delete the printer to reduce confusion.

Warning: Some printer driver wizards require the printer to be attached to the PC during installation. 

Share the Local Printer on Remote

First share the printer on the remote PC.  Make the share name short and sweet with no spaces for simplicity like "hplj4".  Note the share name you use.

http://www.microsoft.com/windowsxp/using/networking/expert/honeycutt_july2.mspx 

Next make sure you know what your PC is named.  On XP right click My Computer and select properties.  Click the "Computer Name" tab.  Note "Full Computer name:"

 Net Use Command for Redirection

 On the remote PC  bring up a command prompt (Start, Run, cmd, Ok).

 Now you are ready to redirect with "net use".

At the command prompt type:

net use lpt3: \\full_computer_name\printer_share_name (hit enter)

You should get:

The command completed successfully.

To verify it worked type:

net use (hit enter)

You should get:

Status    Local    Remote                                                                            Network ----------------------------------------------------------------------------------------
Ok            LPT3   \\full_computer_name\printer_share_name       Microsoft..

 

By default when a net use command is successful it is "persistent" meaning you can reboot your PC and  any print jobs sent to LPT3 will be redirected to that printer.  This can work but it may get broken for some unknown reason (this is Windows) and you will have to re-run the net use command.  One solution for stability is to use the /persistent:no switch and then create a batch file and place it in the "All Users" Startup folder.

Before using the /persistent:no switch we need to delete the redirect we just did or it will error out with:

The local device name is already in use.

To delete the redirection type:

net use LPT3 /d (hit enter)

You should get:

The command completed successfully.

Now type: 

 net use LPT3 \\full_computer_name\printer_share_name /persistent:no (hit enter)

You should get: 

The command completed successfully.

Now if the PC is rebooted the redirect will be lost.  But we make it more reliable by resetting it each time the PC boots with a batch file in "All Users" Startup.

Create Batch File and Place in the All Users Startup Folder

Login to the remote PC as a user with administrator privileges. 

Open the Notepad program.  Start, All Programs, Accessories, Notepad.

Type:

 net use LPT3 \\full_computer_name\printer_share_name /persistent:no

Click File, Save As...

Change Save as type to "All files".

In File Name: type print.bat

Browse to the Desktop and click Save.

Right click on Start and select "Explore"

Drill down to Documents and settings, All Users, Start Menu, Programs, Startup.

Left click drag and drop the print.bat batch file into Startup.

Reboot the PC then open the Command Prompt and type:

net use (hit enter)

You should get:

Status    Local    Remote                                                                Network
----------------------------------------------------------------------------------------
Ok            LPT3   \\full_computer_name\printer_share_name        Microsoft..

Now you are ready to add the local printer to your PC but use local port LPT3.

When you add the printer a second time it will automatically change the printer name to:

Local_Printer (Copy 1) 

For clarification I like to rename to:

Local_Printer LPT3

Now when you use Remote Desktop and connect to a session that printer will appear as available so you can print to your locally attached printer like this:

Local_Printer LPT3 on full_compter_name (full_computer_name) in session #

 Printing will be slower but it beats driving down to the office.

 

 

 

 

 

 

 

 

 

Last Updated on Sunday, 06 July 2008 17:27