Adding or Removing Printers (VBScript)
- Details
- Category: Scripts and Code
- Published on Monday, 07 November 2011 05:15
- Written by Christian Dunn
Adding or Removing printers using VBScript.
The following script can be triggered by adding the path to the vbs file to the network logon script.
Printers can be added or removed when this script is run.
Set WshNetwork = WScript.CreateObject("WScript.Network")
'Remove old Printers
PrinterPath = "\\server\printershare"
WshNetwork.RemovePrinterConnection PrinterPath, true, true'Add New Printers
PrinterPath = "\\server\printershare\"
WshNetwork.AddWindowsPrinterConnection PrinterPath