03.22.09
Fix: Remote Desktop changes Default Printer
I often use Remote Desktop to connect into my home office computer from a laptop. I’m running Vista Business SP1 and have found that every time I log back on locally my default printer is no longer assigned. In fact, Windows has no printer assigned as default.
This leads to silly (and false) messages such as “Publisher cannot print. There is no printer installed.”
The problem is related to Remote Desktop and Printer Redirection. When you connect from a client your printer gets changed to the local printer on the client. When you connect back locally it is not re-establishing your previous default printer.
Microsoft allegedly is aware of the problem, but their workaround is to Turn off printer redirection or Manually reset the default printer each time. Nice one, guys.
My solution was a simple VBS script and Windows task scheduler. Using VBS you can set a default printer. Create a new text document with the following code in it:
Set WSHNetwork = CreateObject(”WScript.Network”)
WSHNetwork.SetDefaultPrinter “Brother HL-5250DN series”
Replace “Brother HL-5250DN” with the exact name of your printer as it appears in the Printers folder. Save this as updateprinter.vbs in your user directory. Test the script by changing your default printer and then double-clicking on the script. It should bounce right back.
Now start the Task Scheduler (Start -> All Programs -> Accessories -> System Tools) and click Create Task in the actions pane. Give the task a name and go to the Triggers tab and add a new trigger. Set the task to begin “On Connection to User Session” and make sure it’s just set to your username (other users may not have permission to access to your script). Next choose “Connection from local computer.”
Now you need to set an action to execute the script. Save your new trigger and go to the Actions tab. Add an action to “Start a Program” and browse to locate your script. Click OK. Finally, take a look at the Options and Settings tabs and configure to meet your needs. I recommend “Stop the task if it runs longer than 15 minutes” and executing regardless of AC power.
So what you’ve done is told windows to execute a script whenever you connect to your session locally. This script resets your printer back to usual. You could also use this to assign a specific printer when you’re logged in remotely and another for local sessions. Enjoy!

Scott said,
May 12, 2009 at 9:08 am
Hey Rob,
Thanks for the great solution, but I did find a couple of issues to let others know about in case they stumble across this as well.
First, when you copy the above code the quotes need to be retyped due to some kind of issue with the font. Otherwise it works great.
Secondly, the script did not seem to work for me when specifying a network printer. I had to create the network printer as a “local” printer for this to work. I tried using the actual display name in the Printers dialog as well as the name of the printer on the server and also the share name. Nothing seemed to work until I created the network printer as local.
Otherwise GREAT workaround.