+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, Delete old network printers in Coding and Web Development; Hi there I currently use vbs script to map network printers. We have changed printers recently and all is fine ...
  1. #1

    Join Date
    Dec 2009
    Location
    UK
    Posts
    113
    Thank Post
    15
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Delete old network printers

    Hi there

    I currently use vbs script to map network printers. We have changed printers recently and all is fine with the script (below)

    Dim net
    Set net = CreateObject("Wscript.Network")
    net.AddWindowsPrinterConnection "\\curricsvr\ictcolour"
    net.AddWindowsPrinterConnection "\\curricsvr\reprophotocopier"
    net.AddWindowsPrinterConnection "\\curricsvr\receptionphotocopier"


    What I need to know is how I delete the old ones from appearing in the users printers list. I have deleted these off the print server but the icons still appear on users with "unable to connect". Can someone using my script above edit it to make it do what I need. The old printers names were:
    \\curricsvr\ictmono
    \\curricsvr\planning

    Thanks

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,686
    Thank Post
    333
    Thanked 513 Times in 481 Posts
    Rep Power
    178
    Code:
    net.RemovePrinterConnection "\\curricsvr\ictmono"
    net.RemovePrinterConnection "\\curricsvr\planning"
    Should work.

    (There's also option to force remove if you want to add paramters etc)

    Edit - Just to expand:

    Code:
    Example:
    net.RemovePrinterConnection ("\\curricsvr\ictmono", true, true)
    
       bForce  : Force the removal of the mapped printer. 
                (Boolean Optional, default = false). 
       
       bUpdateProfile : Save changes in the user's profile
                       (Boolean Optional, default = false)

    Steve
    Last edited by Steve21; 27th May 2011 at 10:43 AM.

  3. #3

    Join Date
    Dec 2009
    Location
    UK
    Posts
    113
    Thank Post
    15
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Thanks Steve

    I will give this a go but I thought I had tried that previously. Do I just add the lines under my existing script?

    When you gave me the alternative to add parameters....what will this do as opposed to the one above

    Thanks

SHARE:
+ Post New Thread

Similar Threads

  1. VB script to delete printers on logoff
    By jgcracknell in forum Scripts
    Replies: 10
    Last Post: 14th December 2009, 10:43 AM
  2. Network Printers
    By Trenton_Lister in forum Network and Classroom Management
    Replies: 8
    Last Post: 1st May 2009, 03:10 PM
  3. Delete printers from Profiles
    By Simcfc73 in forum Windows
    Replies: 3
    Last Post: 15th January 2008, 06:29 PM
  4. delete printers
    By Jonny_sims in forum Scripts
    Replies: 11
    Last Post: 14th June 2007, 02:54 PM
  5. Replies: 7
    Last Post: 27th November 2005, 10:41 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •