Re: Need to remove network printers but not mapped printers
- From: "Larry D" <larryd@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 15 Nov 2005 13:21:56 -0600
I thought that might be a solution but nothing happens when I tried that. I
found that I can remove the old printers specifically by name and since
there are no more than 3 or 4 in any given department I can do it that way.
Still, if someone knows a solution I would prefer a global remove for
printers coming from the printer server.
Thanks for the suggestion,
Larry
"Andrew Cushen" <noone@xxxxxxxxxxxxxxxx> wrote in message
news:boqef.10377$ek6.9256@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Larry:
>
> Can't you just replace this one line:
>
> If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then
>
> With this:
>
> If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = \\printserver Then
>
> ?? That should work.
>
> If "printserver" is not the actual name of the server, you'll need to
> change it.
>
>
> --
> -Andrew Cushen
> ===============================================================
>
> "Larry D" <larryd@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:eLp8LnW6FHA.3636@xxxxxxxxxxxxxxxxxxxxxxx
>>I am renaming my network printers and have tested this script and it
>>removes all network printers and leaves local printers alone:
>>
>> ON ERROR RESUME NEXT
>> Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj,
>> Path
>> Set WSHShell = CreateObject("WScript.Shell")
>> Set WSHNetwork = CreateObject("WScript.Network")
>> Set WSHPrinters = WSHNetwork.EnumPrinterConnections
>> For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2
>> If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then
>> WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER
>> +1),True,True
>> End If
>> Next
>> set UserObj = Nothing
>> set GroupObj = Nothing
>> set WSHNetwork = Nothing
>> set DomainString = Nothing
>> set WSHSHell = Nothing
>> Set WSHPrinters = Nothing
>> wscript.quit
>>
>> Then I use this script to map a renamed printer such as CA - HP LaserJet
>> 4050 PS near Purchasing on the \\printerserver:
>>
>> Set objNetwork = CreateObject("WScript.Network")
>> objNetwork.AddWindowsPrinterConnection "\\printserver\CA - HP LaserJet
>> 4050 PS near Purchasing"
>>
>> The problem is the top script also removes mapped printers that are
>> shared between desktop PCs. How can I change the top script to remove
>> only network printers that are attached to \\printserver and not to
>> \\desktopPC ?
>>
>> Thanks for any help.
>>
>> Larry
>>
>
>
.
- References:
- Need to remove network printers but not mapped printers
- From: Larry D
- Re: Need to remove network printers but not mapped printers
- From: Andrew Cushen
- Need to remove network printers but not mapped printers
- Prev by Date: Re: Need to remove network printers but not mapped printers
- Next by Date: Re: Need to remove network printers but not mapped printers
- Previous by thread: Re: Need to remove network printers but not mapped printers
- Next by thread: Re: Need to remove network printers but not mapped printers
- Index(es):
Relevant Pages
|
|