Changing default printer script
- This topic has 20 replies, 5 voices, and was last updated 13 years, 11 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Home › Forums › Scripting › General Scripting › Changing default printer script
Hi,
I’m looking for a script that changes the default to another printer if the
local printer is not installed on the local PC.
At the moment i have this:
Dim objNetwork
Set objNetwork = CreateObject(“WScript.Network”)
Dim WshShell: Set WshShell = CreateObject(“Wscript.Shell”)
Dim strLocal1, strLocal2, strUNCPrinter1, strUNCPrinter2, strLocal
strUNCPrinter1 = “\print-serverHP Universal Printer for accounts”
strUNCPrinter2 = “\print-serverRicoh Aficio 1224C PCL 5c”
strLocal1 = “\print-serverHPDesignJet”
strLocal2 = “\print-serverDYMO”
strLocal = “Accounts Printer”
objNetwork.AddWindowsPrinterConnection strUNCPrinter1
objNetwork.AddWindowsPrinterConnection strUNCPrinter2
objNetwork.AddWindowsPrinterConnection strLocal1
objNetwork.AddWindowsPrinterConnection strLocal2
objNetwork.SetDefaultPrinter strLocal
WScript.Quit
strLocal is the locally installed printer but if it doesn’t exist i want the
default printer to be strUNCPrinter2.
Please help, many thanks
You must be logged in to reply to this topic.
Find out more about our cookie policy here.