Showing posts with label VBScript. Show all posts
Showing posts with label VBScript. Show all posts

2021-01-19

Add a network printer & Set a default printer in VBScript

Set WshNetwork = WScript.CreateObject("WScript.Network")
WSHNetwork.AddWindowsPrinterConnection "\\ServerName\PrinterName"
WSHNetwork.SetDefaultPrinter "\\ServerName\PrinterName"

Open Devices & Printers in VBScript

CreateObject("WScript.Shell").Run "control.exe /name Microsoft.DevicesAndPrinters"