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 ...
-
6th October 2010, 10:18 AM #1
- 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"
-
-
IDG Tech News
-
6th October 2010, 10:43 AM #2 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: 
Similar Threads
-
Replies: 2
Last Post: 10th April 2008, 10:49 AM
-
By martyn in forum Scripts
Replies: 13
Last Post: 20th February 2008, 04:29 PM
-
By Heebeejeebee in forum Windows
Replies: 15
Last Post: 5th February 2007, 03:00 PM
-
By speckytecky in forum Wireless Networks
Replies: 1
Last Post: 31st May 2006, 06:44 PM
-
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
-
Forum Rules