![]() | Register | FAQ | Members | Social Groups | User Map | Calendar | Search | Today's Posts | Mark Forums Read |
| Notices |
Windows
Windows forum sponsored by |
| | | LinkBack | Thread Tools | Search Thread | Language |
| Sponsored Links |
| | #1 |
![]() Join Date: May 2007 Location: Portsmouth
Posts: 126
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 0 | cheers :? |
| |
| | #2 |
![]() | 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 |
![]() Join Date: May 2007 Location: Portsmouth
Posts: 126
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 0 | 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 |
![]() | 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 |
![]() Join Date: May 2007 Location: Portsmouth
Posts: 126
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 0 | 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 | |
![]() Join Date: Jul 2006 Location: South Yorkshire
Posts: 2,722
Thanks: 103
Thanked 96 Times in 76 Posts
Rep Power: 29 | Quote:
Works fine for me and would resolve your problem in a heart beat. | |
| |
| | #7 |
![]() Join Date: Dec 2005 Location: Norfolk
Posts: 4,133
Thanks: 30
Thanked 93 Times in 92 Posts
Rep Power: 32 | 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 |
![]() | 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 | |
![]() Join Date: Jan 2007
Posts: 2,240
Thanks: 14
Thanked 79 Times in 61 Posts
Rep Power: 26 | Will do the same as BKGarry's script - it will remove all installed printers first... Quote:
| |
| |
| | #10 |
![]() | 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 |
![]() Join Date: Dec 2005 Location: Norfolk
Posts: 4,133
Thanks: 30
Thanked 93 Times in 92 Posts
Rep Power: 32 | 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 |
![]() Join Date: Jan 2007
Posts: 2,240
Thanks: 14
Thanked 79 Times in 61 Posts
Rep Power: 26 | Someone should write a book: 101 ways to install a printer..... ;-) |
| |
| | #13 |
![]() | and 6000000000000000 isues when dealing with, maintaining and deleting them |
| |
| | #14 |
![]() Join Date: May 2006 Location: Deepest, Darkest, Suburban, Swingin' Surrey
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 | I use CON2PRT /F and it will do the job of removing any attached printers that are not local. |
| |
| | #15 |
![]() | 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. |
| |
| |
| | ||||
| 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 |
|
|







