+ Post New Thread
Results 1 to 15 of 15
Windows Thread, Printer Connections - I NEED HELP PLEASE in Technical; hi all, we run a 2003 server domain with xp client. i have just renamed the priniters on ther server ...
  1. #1
    Mr_M_Cox's Avatar
    Join Date
    May 2007
    Location
    Portsmouth
    Posts
    155
    Thank Post
    5
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Printer Connections - I NEED HELP PLEASE

    hi all, we run a 2003 server domain with xp client. i have just renamed the priniters on ther server but not changed the share name or port etc. our printer are connected to clients using a VB script in a Group Policy. This is all working well. the problem i have is that now i have chaged the name there is the old name which wont work any more AND the new one which does work. how can i delete the old printer connection across the whole network of clients. do i have to go to each work station and delete the profiles?

    cheers :?

  2. #2
    BKGarry's Avatar
    Join Date
    Mar 2006
    Location
    Kent
    Posts
    1,012
    Thank Post
    105
    Thanked 141 Times in 112 Posts
    Rep Power
    51

    Re: Printer Connections - I NEED HELP PLEASE

    try this code

    On Error Resume Next



    Set objNetwork = CreateObject("WScript.Network")

    Set objShell = WScript.CreateObject("WScript.Shell")

    Set colSystemEnvVars = objShell.Environment("Process")


    objNetwork.RemovePrinterConnection "\\pserver\room32"
    objNetwork.RemovePrinterConnection "\\pserver\room32C"


    but use your server and printer name

  3. #3
    Mr_M_Cox's Avatar
    Join Date
    May 2007
    Location
    Portsmouth
    Posts
    155
    Thank Post
    5
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Printer Connections - I NEED HELP PLEASE

    thanks for the help but i dont think i explained it very well. the problem is not with the server the problem is the Xp clients having 2 printer connections showning but it is the same printer one with an old name and one with the new name. how can i delete the old name from the clients across all users.
    cheers

  4. #4
    BKGarry's Avatar
    Join Date
    Mar 2006
    Location
    Kent
    Posts
    1,012
    Thank Post
    105
    Thanked 141 Times in 112 Posts
    Rep Power
    51

    Re: Printer Connections - I NEED HELP PLEASE

    use the script about to remove the printers before your script runs by just adding the lines in the have it add them afterwards.

    We have the same problem with it being the profile remebering the printer thats why we use the remove printer connection first.

  5. #5
    Mr_M_Cox's Avatar
    Join Date
    May 2007
    Location
    Portsmouth
    Posts
    155
    Thank Post
    5
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Printer Connections - I NEED HELP PLEASE

    thanks for the help but i did not work, is there no way to get windows to delete printer connections which are offline or dead

  6. #6
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    119

    Re: Printer Connections - I NEED HELP PLEASE

    Quote Originally Posted by Mr_M_Cox
    thanks for the help but i did not work, is there no way to get windows to delete printer connections which are offline or dead
    Your best bet is to use one of the printer scripts as a login script to remove all networked printers on workstations and then add the current ones.

    Works fine for me and would resolve your problem in a heart beat.

  7. #7

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,681
    Thank Post
    755
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438

    Re: Printer Connections - I NEED HELP PLEASE

    That should work I use:

    dim wNet
    set wNet = createobject("wscript.network")
    'Remove ALL old printers
    'Enumerate all printers first, after that you can select the printers you want by performing some string checks
    Set WSHPrinters = WNet.EnumPrinterConnections
    For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2
    'To remove only networked printers use this If Statement
    If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then
    WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True
    End If
    'To remove all printers incuding LOCAL printers use this statement and comment out the If Statement above
    'WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True
    Next
    'end delete existing printers

    Which does the same thing but will just loop through all the printer connections itself.

    Ben

  8. #8
    BKGarry's Avatar
    Join Date
    Mar 2006
    Location
    Kent
    Posts
    1,012
    Thank Post
    105
    Thanked 141 Times in 112 Posts
    Rep Power
    51

    Re: Printer Connections - I NEED HELP PLEASE

    There is the old con2prt.exe that was included in the nt4 admin kit, but i have never used it on nt4 (never even used it) and running that with the /f command deltes all connections.

  9. #9

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,249
    Thank Post
    1,061
    Thanked 1,070 Times in 626 Posts
    Rep Power
    741

    Re: Printer Connections - I NEED HELP PLEASE

    Will do the same as BKGarry's script - it will remove all installed printers first...

    rem ** Next line must not be deleted **
    Set WshNetwork = CreateObject("WScript.Network")

    rem ** This will delete existing printers **
    On Error Resume Next
    Set oPrinters = WshNetwork.EnumPrinterConnections
    For i = 1 to oPrinters.Count - 1 Step 2
    WshNetwork.RemovePrinterConnection oPrinters.Item(i)
    Next

    Set WshNetwork = CreateObject("WScript.Network")
    WshNetwork.AddWindowsPrinterConnection "\\YOURSERVER\PRINTER"
    WshNetwork.AddWindowsPrinterConnection "\\YOURSERVER\PRINTER"
    WshNetwork.AddWindowsPrinterConnection "\\YOURSERVER\PRINTER"


    rem ** Setup default printer **
    WshNetwork.SetDefaultPrinter "\\YOURSERVER\PRINTER"

  10. #10
    BKGarry's Avatar
    Join Date
    Mar 2006
    Location
    Kent
    Posts
    1,012
    Thank Post
    105
    Thanked 141 Times in 112 Posts
    Rep Power
    51

    Re: Printer Connections - I NEED HELP PLEASE

    Just a thought, the old one isn't installed through the method of adding a local port on the machine pointing to the server and then installing the drivers.

    That could be why it is still there because we are all trying to delete a network printer, not a local printer that prints to a network port.

  11. #11

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,681
    Thank Post
    755
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438

    Re: Printer Connections - I NEED HELP PLEASE

    Mattx your script does the same as the one I posted excpet that mine has the option in it to only delete network printers or to delete all printers like yours does.

    Ben

  12. #12

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,249
    Thank Post
    1,061
    Thanked 1,070 Times in 626 Posts
    Rep Power
    741

    Re: Printer Connections - I NEED HELP PLEASE

    Someone should write a book:

    101 ways to install a printer..... ;-)

  13. #13
    BKGarry's Avatar
    Join Date
    Mar 2006
    Location
    Kent
    Posts
    1,012
    Thank Post
    105
    Thanked 141 Times in 112 Posts
    Rep Power
    51

    Re: Printer Connections - I NEED HELP PLEASE

    and 6000000000000000 isues when dealing with, maintaining and deleting them

  14. #14

    Join Date
    May 2006
    Location
    Surrey
    Posts
    64
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Printer Connections - I NEED HELP PLEASE

    I use CON2PRT /F and it will do the job of removing any attached printers that are not local.

  15. #15

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    Boston, MA
    Posts
    7,601
    Thank Post
    110
    Thanked 771 Times in 599 Posts
    Rep Power
    183

    Re: Printer Connections - I NEED HELP PLEASE

    You could also try running the script as a startup script if the printer connection has some how got stuck in there as a local printer.



SHARE:
+ Post New Thread

Similar Threads

  1. STOP UNC Connections
    By tomlin in forum Windows
    Replies: 8
    Last Post: 5th December 2007, 01:00 PM
  2. MS Terminal Services Connections
    By Lee_K_81 in forum Thin Client and Virtual Machines
    Replies: 13
    Last Post: 7th November 2007, 10:49 AM
  3. Internet Connections
    By 20RickY06 in forum General Chat
    Replies: 7
    Last Post: 6th September 2006, 09:56 AM
  4. Promethean IWB Connections
    By plexer in forum Hardware
    Replies: 6
    Last Post: 21st July 2006, 05:01 PM
  5. Dual ADSL connections
    By Simcfc73 in forum Wireless Networks
    Replies: 1
    Last Post: 9th March 2006, 10:19 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
  •