Hi.
We have a small script that we run on cumputers that log in to the
domain, the script deletes all printers and then addes a few.
We have a slight problem with the deletion of printers.
When the printer is not a network printer, the script will stop with the
error (here for the printer "Microsoft Office Document Image Writer":
Script: c:\thescript.vbs
Row: X
Col: Y
Error: This network connection
Code: 800708CA
Source: WSHNetwork.RemoveNetworkDrive
The script looks like this and the row that generates the error is the
one marked with "*".
' Begin removing all installed network printers
Set clPrinters = objWshNetwork.EnumPrinterConnections
For i = 0 to clPrinters.Count - 1 Step 2
'wscript.echo clPrinters.Item(i+1) + " deleted."
* objWshNetwork.RemovePrinterConnection clPrinters.Item(i+1), true, true
Next
Any suggestions on how to avoid removing non network drives?
/kb