mkllpit
asked on
VBS to add a network printer and make it the default
Can someone please tell me if this code looks good? It works but I wanted to make usre that there wasnt a better way to write it. Thank you.
Option Explicit
Dim objNetwork, strUNCPrinter
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\printserver\printer"
strUNCPrinter = "\\printserver\printer"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter
objNetwork.SetDefaultPrinter strUNCPrinter
WScript.Quit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.