Page 1 of 1 1
Topic Options
#166175 - 2006-08-21 11:25 PM Delete local printer
SerfKix Offline
Fresh Scripter

Registered: 2005-12-15
Posts: 5
I'm trying to delete some local IP printers, here's a sample of the code I am using.

DelPrinterConnection ("Panasonic DP-4520 (Mail Room)")

I keep getting an 1801 error. The printer names have parenthesis in them and I am wondering if that is the problem and how to get around it.

Any ideas? Thanks!

Top
#166176 - 2006-08-21 11:41 PM Re: Delete local printer
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Check on the actual Share name vs printer name.

That error message says: The printer name is invalid.

Top
#166177 - 2006-08-22 12:07 AM Re: Delete local printer
SerfKix Offline
Fresh Scripter

Registered: 2005-12-15
Posts: 5
There is no share name because the printers are installed locally on each user's computer. Should I be using a different method or function?
Top
#166178 - 2006-08-22 12:08 AM Re: Delete local printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK

delprinterconnection disconnects network printers.
you are trying to "uninstall" a local printer.

two different things.

Top
#166179 - 2006-08-22 01:39 AM Re: Delete local printer
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
One way would be to remove it from the registry:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports

And then stop and start the spooler service for the changes to go into effect.

{edit: well this would get rid of the port anyway.. not the printer}


Edited by Allen (2006-08-22 01:41 AM)

Top
#166180 - 2006-08-22 03:03 AM Re: Delete local printer
SerfKix Offline
Fresh Scripter

Registered: 2005-12-15
Posts: 5
Yeah, looks like I'll just have to delete them straight from the registry. Thanks for the info!
Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.058 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org