Urgent 500 points deleting a network printer from users

Posted on 2005-04-06
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 70

    Accepted Solution


    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

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    Recovering backup .Qic files on Windows 7 6 2,077
    Closing cmd window after script execution 4 199
    Windows 16 331
    Screen Mirroring 7 23
    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…
    If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now