Learn how to a build a cloud-first strategyRegister Now


Urgent 500 points deleting a network printer from users

Posted on 2005-04-06
Medium Priority
Last Modified: 2010-04-14
have a win 2k logon script for users that added a printer as so using kix

If ADDPRINTERCONNECTION ("\\file02abzpi\lj4v") = 0
  ? "Added printer connection...."

How do i delete this printer using the script
Question by:ellandrd
LVL 71

Accepted Solution

Chris Dent earned 2000 total points
ID: 13716475

The Kix function:

DelPrinterConnection("<Your Printer>")

Can be used to delete printers added using the AddPrinterConnection function.

If you need to remove printers that were not added using Kix you could use VBScript (I'm not sure if a batch file can do it).

The code for doing the same in VBScript is:

Set objNetwork = CreateObject("WScript.Network")
objNetwork.RemovePrinterConnection "<Your Printer>"


LVL 16

Expert Comment

ID: 13717369
Here is a post I made earlier that has an example of removing an existing printer and changing it to a new printer on a different server. It could easily be modified to just delete the printer if it exists or switch to a printer on the same server. Let me know if it's what you're looking for. If you're not sure what to modify let me know and I'll change it for you.


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

810 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