Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

Notices

Windows

Windows forum sponsored by

For all of your Windows problems

Go Back   EduGeek.net Forums > Technical > Windows
Reply
 
LinkBack Thread Tools Search Thread Language
Sponsored Links
Old 06-06-2007, 10:53 AM   #1
 
Mr_M_Cox's Avatar
 
Join Date: May 2007
Location: Portsmouth
Posts: 126
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 0 Mr_M_Cox has a little shameless behaviour in the past
Default 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 :?
  Reply With Quote
Old 06-06-2007, 10:57 AM   #2
 
BKGarry's Avatar
 
Join Date: Mar 2006
Location: Northfleet, Kent
Posts: 320
Thanks: 3
Thanked 2 Times in 2 Posts
Rep Power: 6 BKGarry is on a distinguished road
Send a message via MSN to BKGarry Send a message via Skype™ to BKGarry
Default 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
  Reply With Quote
Old 06-06-2007, 12:23 PM   #3
 
Mr_M_Cox's Avatar
 
Join Date: May 2007
Location: Portsmouth
Posts: 126
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 0 Mr_M_Cox has a little shameless behaviour in the past
Default 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
  Reply With Quote
Old 06-06-2007, 12:48 PM   #4
 
BKGarry's Avatar
 
Join Date: Mar 2006
Location: Northfleet, Kent
Posts: 320
Thanks: 3
Thanked 2 Times in 2 Posts
Rep Power: 6 BKGarry is on a distinguished road
Send a message via MSN to BKGarry Send a message via Skype™ to BKGarry
Default 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.
  Reply With Quote
Old 06-06-2007, 01:16 PM   #5
 
Mr_M_Cox's Avatar
 
Join Date: May 2007
Location: Portsmouth
Posts: 126
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 0 Mr_M_Cox has a little shameless behaviour in the past
Default 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
  Reply With Quote
Old 06-06-2007, 01:19 PM   #6
 
contink's Avatar
 
Join Date: Jul 2006
Location: South Yorkshire
Posts: 2,722
uk uk yorkshire
Thanks: 103
Thanked 96 Times in 76 Posts
Rep Power: 29 contink is a name known to allcontink is a name known to allcontink is a name known to allcontink is a name known to allcontink is a name known to allcontink is a name known to all
Default 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.
  Reply With Quote
Old 06-06-2007, 01:19 PM   #7
 
plexer's Avatar
 
Join Date: Dec 2005
Location: Norfolk
Posts: 4,133
uk
Thanks: 30
Thanked 93 Times in 92 Posts
Rep Power: 32 plexer is a glorious beacon of lightplexer is a glorious beacon of lightplexer is a glorious beacon of lightplexer is a glorious beacon of lightplexer is a glorious beacon of lightplexer is a glorious beacon of light
Default 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
  Reply With Quote
Old 06-06-2007, 01:23 PM   #8
 
BKGarry's Avatar
 
Join Date: Mar 2006
Location: Northfleet, Kent
Posts: 320
Thanks: 3
Thanked 2 Times in 2 Posts
Rep Power: 6 BKGarry is on a distinguished road
Send a message via MSN to BKGarry Send a message via Skype™ to BKGarry
Default 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.
  Reply With Quote
Old 06-06-2007, 01:24 PM   #9
 
mattx's Avatar
 
Join Date: Jan 2007
Posts: 2,240
uk uk city of london
Thanks: 14
Thanked 79 Times in 61 Posts
Rep Power: 26 mattx is a name known to allmattx is a name known to allmattx is a name known to allmattx is a name known to allmattx is a name known to allmattx is a name known to all
Default Re: Printer Connections - I NEED HELP PLEASE

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

Quote:
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"
  Reply With Quote
Old 06-06-2007, 01:26 PM   #10
 
BKGarry's Avatar
 
Join Date: Mar 2006
Location: Northfleet, Kent
Posts: 320
Thanks: 3
Thanked 2 Times in 2 Posts
Rep Power: 6 BKGarry is on a distinguished road
Send a message via MSN to BKGarry Send a message via Skype™ to BKGarry
Default 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.
  Reply With Quote
Old 06-06-2007, 01:33 PM   #11
 
plexer's Avatar
 
Join Date: Dec 2005
Location: Norfolk
Posts: 4,133
uk
Thanks: 30
Thanked 93 Times in 92 Posts
Rep Power: 32 plexer is a glorious beacon of lightplexer is a glorious beacon of lightplexer is a glorious beacon of lightplexer is a glorious beacon of lightplexer is a glorious beacon of lightplexer is a glorious beacon of light
Default 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
  Reply With Quote
Old 06-06-2007, 01:53 PM   #12
 
mattx's Avatar
 
Join Date: Jan 2007
Posts: 2,240
uk uk city of london
Thanks: 14
Thanked 79 Times in 61 Posts
Rep Power: 26 mattx is a name known to allmattx is a name known to allmattx is a name known to allmattx is a name known to allmattx is a name known to allmattx is a name known to all
Default Re: Printer Connections - I NEED HELP PLEASE

Someone should write a book:

101 ways to install a printer..... ;-)
  Reply With Quote
Old 06-06-2007, 01:54 PM   #13
 
BKGarry's Avatar
 
Join Date: Mar 2006
Location: Northfleet, Kent
Posts: 320
Thanks: 3
Thanked 2 Times in 2 Posts
Rep Power: 6 BKGarry is on a distinguished road
Send a message via MSN to BKGarry Send a message via Skype™ to BKGarry
Default Re: Printer Connections - I NEED HELP PLEASE

and 6000000000000000 isues when dealing with, maintaining and deleting them
  Reply With Quote
Old 07-06-2007, 04:09 PM   #14
 
snrweb's Avatar
 
Join Date: May 2006
Location: Deepest, Darkest, Suburban, Swingin' Surrey
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 snrweb is an unknown quantity at this point
Default 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.
  Reply With Quote
Old 07-06-2007, 06:00 PM   #15
 
Ric_'s Avatar
 
Join Date: Jun 2005
Location: Lancashire
Posts: 5,502
uk uk lancashire
Thanks: 27
Thanked 141 Times in 124 Posts
Rep Power: 42 Ric_ is a splendid one to beholdRic_ is a splendid one to beholdRic_ is a splendid one to beholdRic_ is a splendid one to beholdRic_ is a splendid one to beholdRic_ is a splendid one to beholdRic_ is a splendid one to behold
Send a message via MSN to Ric_ Send a message via Skype™ to Ric_
Default 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.
  Reply With Quote
Reply

Register now for FREE and post messages!


Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Birthday:      
Image Verification
  I agree to forum rules 

Similar Threads
Thread Thread Starter Forum Replies Last Post
STOP UNC Connections tomlin Windows 8 05-12-2007 01:00 PM
MS Terminal Services Connections Lee_K_81 Thin Client and Virtual Machines 13 07-11-2007 10:49 AM
Internet Connections 20RickY06 General Chat 7 06-09-2006 08:56 AM
Promethean IWB Connections plexer Hardware 6 21-07-2006 04:01 PM
Dual ADSL connections Simcfc73 Networks 1 09-03-2006 10:19 AM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +1. The time now is 09:46 PM.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright EduGeek.net