'==========================================================================
'
' NAME: RemoveNetPrinters.vbs
' COMMENT: Removes and add all net printers (XP Only)
'
'==========================================================================
ON ERROR RESUME NEXT
Set wshNet = CreateObject("WScript.Network")
Set wshPrn = wshNet.EnumPrinterConnections
For x = 0 To wshPrn.Count - 1 Step 2
If Left(wshPrn.Item(x+1),2) = "\\" Then wshNet.RemovePrinterConnection wshPrn.Item(x+1),True,True
Next
wshnet.AddWindowsPrinterConnection "\\server\printer01"
wshnet.AddWindowsPrinterConnection "\\server\printer02"
wshnet.SetDefaultPrinter "\\server\printer02"
'==========================================================================