fandabbydosey
MIS
Hello,
I am using markdmac's script to remove all network attached printers and attach new network printers using GP logon script.
Below is the full and only script I am using......
Dim WSHNetwork
Set WSHNetwork = CreateObject("WScript.Network")
Set WSHPrinters = WSHNetwork.EnumPrinterConnections
For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2
If Left(WHSPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then
WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER+1),True,True
End If
Next
WSHNetwork.AddWIndowsPrinterConnection "\\TRB_SVR1\HP5000_1"
Set WSHNetwork = Nothing
Set WSHPrinters = Nothing
wscript.quit
But when I run it I recieve the error.
"Object Required WSHPrinters"
Any Advice?
Thanks
Fandab
I am using markdmac's script to remove all network attached printers and attach new network printers using GP logon script.
Below is the full and only script I am using......
Dim WSHNetwork
Set WSHNetwork = CreateObject("WScript.Network")
Set WSHPrinters = WSHNetwork.EnumPrinterConnections
For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2
If Left(WHSPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then
WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER+1),True,True
End If
Next
WSHNetwork.AddWIndowsPrinterConnection "\\TRB_SVR1\HP5000_1"
Set WSHNetwork = Nothing
Set WSHPrinters = Nothing
wscript.quit
But when I run it I recieve the error.
"Object Required WSHPrinters"
Any Advice?
Thanks
Fandab