+ Post New Thread
Results 1 to 6 of 6
Windows Thread, Remove Printer in Profile in Technical; Hi, Just been told we are getting a new photocopier next week. Our current photocopier is networked so people can ...
  1. #1

    Join Date
    Apr 2007
    Location
    York
    Posts
    564
    Thank Post
    11
    Thanked 4 Times in 4 Posts
    Rep Power
    20

    Remove Printer in Profile

    Hi,

    Just been told we are getting a new photocopier next week. Our current photocopier is networked so people can print to it. Problem we have is that it is in the default profile on the network (created before I started). Without creating a new profile, is there a script that will remove the printer on logon ?

    Currently using this in one of my scripts but I doesn't seem to get rid of the photocopier?

    'objNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True
    Next
    'end delete existing printers

    Thanks

    Karl

  2. #2

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,265
    Thank Post
    242
    Thanked 1,575 Times in 1,254 Posts
    Rep Power
    341
    This is the trouble with printer scripts. They also puts lots of entries into the registry which can complicate things. I'm not sure of the best route to remove the printer (other than updating the default profile on every machine). You should also consider looking into deploying new printers with group policies.

  3. #3


    Join Date
    Sep 2008
    Posts
    1,806
    Thank Post
    332
    Thanked 262 Times in 214 Posts
    Rep Power
    120
    Try creating the script and running it locally first. you may find the reason why its not working. And I assume that delete printer line isn't commented out in your script?

    I have used this(taken from someone here i think)

    On error resume next

    'Remove's All Network Objects (Printers and Drives)

    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Set oPrinters = WshNetwork.EnumPrinterConnections

    For i = 0 to oPrinters.Count - 1 Step 2
    WshNetwork.RemovePrinterConnection oPrinters.Item(i+1)


    Next
    WScript.Quit

    To give yourself time to do it, you could add the new printer and make it the default so nobody tries to print to the old one.

  4. #4

    Join Date
    Apr 2007
    Location
    York
    Posts
    564
    Thank Post
    11
    Thanked 4 Times in 4 Posts
    Rep Power
    20
    OK. Got a script that does the job great. However, when its done it for one user, if that user logs on again, they get an error message saying itcan't find the printer, which is true. Is there a way to ignore if printer doesn't exist?

    Option Explicit
    Dim objNetwork, strUNCPrinter, bForce, bUpdateProfile
    strUNCPrinter = "\\2003server\Ricoh Aficio 1060 RPCS"
    bForce = "True"
    bUpdateProfile = "False"

    Set objNetwork = CreateObject("WScript.Network")
    ' Section which removes the network printer
    objNetwork.RemovePrinterConnection strUNCPrinter, _
    bForce, bUpdateProfile

    WScript.Echo "Check Printers folder NO: " & strUNCPrinter
    Wscript.Quit

    Thanks

  5. #5

    Join Date
    Apr 2007
    Location
    York
    Posts
    564
    Thank Post
    11
    Thanked 4 Times in 4 Posts
    Rep Power
    20
    Solved it !!! "on error resume next"

  6. #6
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,700
    Thank Post
    172
    Thanked 224 Times in 207 Posts
    Rep Power
    68
    This one worked well for me...

    On error Resume Next

    Dim objNetwork
    Dim strUNCPrinter1

    strUNCPrinter1 = "\\grs-server\printer"

    Set objNetwork = CreateObject("WScript.Network")

    objNetwork.RemovePrinterConnection strUNCPrinter1

    Wscript.Quit


    The first script with the LOOP COUNTER bit looks similar to one we had years ago, never worked properly lol

    Quote Originally Posted by Michael View Post
    You should also consider looking into deploying new printers with group policies.
    Unless you like to control your default printers hehe!
    Last edited by gshaw; 9th February 2009 at 05:05 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. GPO to remove printer properites
    By eejit in forum Windows
    Replies: 15
    Last Post: 21st May 2009, 02:27 PM
  2. Unique printer driver in user profile?!?
    By Ben_Stanton in forum How do you do....it?
    Replies: 13
    Last Post: 29th December 2008, 01:06 PM
  3. Replies: 1
    Last Post: 25th January 2008, 10:53 AM
  4. Replies: 0
    Last Post: 20th August 2007, 02:20 PM
  5. Printer Settings / Language Bar - profile
    By spike in forum Windows
    Replies: 2
    Last Post: 17th February 2006, 09:54 AM

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
  •