Remotely uninstall printer and set new default printer

Posted on 2005-04-19
Last Modified: 2012-08-14
I'm a Win2000 newbie.
Win2000 Server and Win200 Clients within a domain.

I have installed a new printer in our network. The drivers are installed on all clients.
Now I need to set this printer as default printer for ALL USERS that log onto one of the machines.
And I want to uninstall the old printer from ALL the MACHINES.

How can I do this remotely?

Question by:olio
    LVL 1

    Expert Comment

    Use this in youre loginsript:

    Function MakePrinter(Printer, Server, Default)

    Dim PrinterPath, PrinterDriver
    PrinterPath = "\\" & Server & "\" & Printer
    PrinterDriver = Printer
    WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
    If Default = True Then WshNetwork.SetDefaultPrinter PrinterPath

    End Function

    Remove one:
    Function RemovePrinter(Printer, Server)

    Dim PrinterPath, PrinterDriver, DelPrint
    PrinterPath = "\\" & Server & "\" & Printer
    Set DelPrint = WScript.CreateObject("WScript.Network")
    DelPrint.RemovePrinterConnection PrinterPath , true, true

    End Function
    LVL 1

    Accepted Solution

    Set WshNetwork = CreateObject("WScript.Network")
    To MakePrinter
    LVL 1

    Author Comment

    The printers are on a peer-to-peer network, i.e. directly (though TCP/IP) connected to the machines.

    Where do I have to store the login script?
    How do I assign it to all users or machines?
    How can I check that the script ran?
    Will it run every time or once per machine or user?

    SORRY AND THANKS, i'm really a newbie


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    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…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    728 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

    19 Experts available now in Live!

    Get 1:1 Help Now