+ Post New Thread
Results 1 to 2 of 2
Windows Thread, Setting the local printer as the default running alongside network printers in Technical; Hi, At our school we use two VBScripts to both add and make the appropriate printer the default. In many ...
  1. #1

    Join Date
    Dec 2009
    Posts
    6
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Setting the local printer as the default running alongside network printers

    Hi, At our school we use two VBScripts to both add and make the appropriate printer the default. In many circumstances e.i. in offices where a local printer is present, this needs to be the default. Every now and again when the user logs on in an office where a local printer is present the default printer gets set to something random. This causes issues as some programs only print to the default printer.

    Below is what I use to set the default printer by OU, as every office doesn't have there own OU, is there a peice of VBS that I can add to the end to make the local print the default or "anything" using port "USB001" the default for instance.

    Set objSysInfo = CreateObject("ADSystemInfo")
    strName = objSysInfo.ComputerName

    arrComputerName = Split(strName, ",")
    arrOU = Split(arrComputerName(1), "=")
    strComputerOU = arrOU(1)

    Set objNetwork = CreateObject("WScript.Network")

    Select Case strComputerOU
    Case "UsLib"
    objNetwork.SetDefaultPrinter "\\presley\uslib-mono"
    Case "R20"
    objNetwork.SetDefaultPrinter "\\presley\r20-mono"
    Case "R22"
    objNetwork.SetDefaultPrinter "\\presley\r22-mono"
    Case "R23"
    objNetwork.SetDefaultPrinter "\\presley\r23-mono"
    Case "R40"
    objNetwork.SetDefaultPrinter "\\presley\r40-mono"

  2. #2


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,641
    Thank Post
    229
    Thanked 865 Times in 743 Posts
    Rep Power
    297
    easieat way ive found was to just name ALL local printers Local printer and y vbs script just sets the default to whatever the default is for that area then sets the default to local printer that way if it hasnt got a local printer it fails that part leaving the default printer the normal default something like (in this partiular school the printers themselves are deployed by ad)

    ' Printers.vbs - Jonathan
    Option Explicit
    Dim objNetwork
    on error resume next

    Set objNetwork = CreateObject("WScript.Network")

    objNetwork.SetDefaultPrinter "\\gateway\Photocopier (ICT Suite)"
    objNetwork.SetDefaultPrinter "local printer"

SHARE:
+ Post New Thread

Similar Threads

  1. Problem setting default printers
    By Kyle in forum Windows
    Replies: 2
    Last Post: 10th April 2008, 10:49 AM
  2. Replies: 13
    Last Post: 20th February 2008, 04:29 PM
  3. Set Default Printer to Machines with Local Printers
    By Heebeejeebee in forum Windows
    Replies: 15
    Last Post: 5th February 2007, 03:00 PM
  4. Change network printer default setting
    By speckytecky in forum Wireless Networks
    Replies: 1
    Last Post: 31st May 2006, 06:44 PM
  5. Setting a permanent default printer.
    By ninjabeaver in forum Windows
    Replies: 25
    Last Post: 23rd August 2005, 05:55 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •