Chuckster Posted January 27, 2010 Posted January 27, 2010 When people search for printers they see all the current printers and those that no longer exist. In the past some printers were shared out via a parallel connection to a workstation but this is no longer the case anymore. My problem is, is that some workstations were rebuilt but this didn't remove the printer entry when you search for printers via Printers and Faxes. Is there a way of deleting entries of printers that are no longer available and/or exist?
ICT_GUY Posted January 27, 2010 Posted January 27, 2010 'Delete all printers 'on error resume next set wNet = createobject("wscript.network") Set wshNetwork = CreateObject("WScript.Network") 'Remove ALL old printers 'Enumerate all printers first, after that you can select the printers you want by performing some string checks Set WSHPrinters = WNet.EnumPrinterConnections For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2 'To remove only networked printers use this If Statement If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True End If 'To remove all printers incuding LOCAL printers use this statement and comment out the If Statement above 'WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True Next 'end delete existing printers 1
ricki Posted January 27, 2010 Posted January 27, 2010 Hi I use a line in my printer script that removes other no set printers that are not in the script with \\server\location\CON2PRT /F Richard 1
enjay Posted January 27, 2010 Posted January 27, 2010 On the server, Active Directory Users & Computers, right-click on Establishment, click Find, select "Printers" from the drop-down in the top left, and click Find Now. All your shared printers will be listed, so simply delete the ones you no longer wish to be visible. 1
Chuckster Posted January 27, 2010 Author Posted January 27, 2010 On the server, Active Directory Users & Computers, right-click on Establishment, click Find, select "Printers" from the drop-down in the top left, and click Find Now. All your shared printers will be listed, so simply delete the ones you no longer wish to be visible. Thank you very much. That worked like a treat.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now