Solved

Delete Multiple Network Printers via registry or batch file

Posted on 2010-08-26
3
748 Views
Last Modified: 2012-05-10
Hi,

I need a batch file or registry file to delete all network printers that point to the server "pluto"

Thanks.
0
Comment
Question by:sd735
3 Comments
 
LVL 8

Expert Comment

by:Pramod Bugudai
ID: 33534057
0
 

Author Comment

by:sd735
ID: 33534134
I need a file because there are multiple print servers.  I only want to remove printers from the Pluto server.
0
 
LVL 3

Accepted Solution

by:
canadianit earned 500 total points
ID: 33534519
I do this regularly with the following:
In my login script I call this

cscript.exe \\tdc\NETLOGON\move3printers.vbs

and in move3printers.vbs I have
on error resume next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")
Set objNetwork = CreateObject("WScript.Network")
WScript.Sleep 2000

'Remove old printers
objNetwork.removePrinterConnection "\\Hebe\HP LaserJet 4300 PCL 6", true, false

'Install current printers
objNetwork.AddWindowsPrinterConnection "\\DC\Black Laser"
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question