Torgeir
Thu Mar 17 13:14:27 CST 2005
richb330 wrote:
> many thanks. I'll give that a go. Going back to the printer script, it
> worked great in a test environment but when i put it leave via logon script
> in a gpo it fails on some users stating that 'The network share cannot be
> found' at:
> WshNetwork.RemovePrinterConnection PrinterPath, True, True
>
> at Ln 40 character 8
>
> This seems to be intermittent and not for every user who logs on. I have
> checked the script host version on the pcs and they are all the same. any
> ideas what could be causing this?
Hi
I don't know about the cause, but to suppress the error, try this:
Instead of
If StrComp(ServerName(PrinterPath), OldServer, 1) = 0 Then
WshNetwork.RemovePrinterConnection PrinterPath, True, True
On Error Resume next
use this:
If StrComp(ServerName(PrinterPath), OldServer, 1) = 0 Then
On Error Resume next
WshNetwork.RemovePrinterConnection PrinterPath, True, True
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx