Default printer in remote session keeps changing, need to force certain one to be default.

Posted on 2007-10-18
Last Modified: 2012-06-22
I am using a universal print driver on our Windows Server/Terminal Server called UniPrint. This has been working very well and does not require any print drivers to be installed on the server. The UniPrint client is installed on each workstation, and directs anything printed on the Terminal Server session to the user's local default printer.
But we recently started using a specialized application that prints to a Dymo Labelwriter on each workstation. We cannot use UniPrint with this application, as it sends special control codes to the Labelwriter, and these codes do not get passed to the Labelwriter when using the UniPrint driver. So we had to turn on Windows Printer Mapping, which had been turned off when we just used UniPrint, in order for the application to direct the label jobs to the label printer.
In order for all this all to work, the UniPrint icon in Printers & Faxes on the server must be the Default Printer, so that all regular print jobs from users use UniPrint to direct the jobs to their local printer, and then the application directs the label printing to the LabelWriter. But now what is happening is that we cannot get the Default Printer choice to "Stick" with the UniPrint. It did work for a few days, but now when a user logs in to the remote server, whatever local printer they have set as the default printer ends up chosen as the default printer on the mapped version on the server.
So the question boils down to: is there any way to force a certain printer on the server to be the default printer, in spite of what the Windows printer mapping wants to do?
Question by:Rohidas357
    LVL 18

    Accepted Solution

    Maybe if you declare what the default printer is in a VBS logon script, maybe that will work. Not sure as i havnt tried it.
    LVL 8

    Assisted Solution

    You can use a .VBS script at logon to set the default printer (as well as add/remove printers) as follows:

    Const OverwriteExisting = True
    Dim objNetwork
    Dim objUser

    Set objNetwork = WScript.CreateObject("WScript.Network")
    Set WshNetwork = WScript.CreateObject("WScript.Network")

    'Remove Printers
      objNetwork.RemovePrinterConnection "\\Server\OldPrinter"

      ' Add Printers
      WshNetwork.AddWindowsPrinterConnection "\\Server\NewPrinter

      'Set Default Printer
      WshNetwork.SetDefaultPrinter "\\Server\Printer1"

    That should do it, if you have formatting questions or technical questions let me know.

    Author Comment

    Things have settled down on our server so that the default printer seems to be holding. I think the previous problem we were having was due to user error.

    I will accept the solutions offered and close the question.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The 6120xp switches seem to have a bug when you create a fiber port channel when you have a UCS fabric interconnects talking to them.  If you follow the Cisco guide for the UCS, the FC Port channel will never come up and it will say that there are n…
    On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now