Solved

Delete Multiple Network Printers via registry or batch file

Posted on 2010-08-26
3
753 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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