Page 1 of 1 1
Topic Options
#151048 - 2005-11-04 03:20 PM Deleting Default Printer
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
Does anyone know if there is a way I can for the users current default printer to delete without deleting all their printers?
Top
#151049 - 2005-11-04 03:27 PM Re: Deleting Default Printer
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
There's a udf to get the default printer ... search for GetDefaultPrinter() in UDF library.

add it to your script and do this :

Code:


if delprinterconnection(GetDefaultPrinter()) = 0
"Default Printer was deleted"
endif


_________________________



Top
#151050 - 2005-11-04 03:32 PM Re: Deleting Default Printer
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You cannot delete a default printer without deleting ALL of them because every time you delete the default, another one will become the default in its place!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151051 - 2005-11-04 03:36 PM Re: Deleting Default Printer
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
He only asked to get the current default deleted, no?
_________________________



Top
#151052 - 2005-11-04 04:27 PM Re: Deleting Default Printer
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Only bippy knows for sure. :/
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151053 - 2005-11-04 04:30 PM Re: Deleting Default Printer
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
LOL, thanks Les. That is what my wife says, only I know.
Actually, I am just trying to delete the current in the profile.

Top
#151054 - 2005-11-04 04:38 PM Re: Deleting Default Printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, what after you have deleted it?
on the next run you will delete some other as the same printer is no longer attached.
and that goes on until no printers avail

or is this part of some bigger logic?
_________________________
!

download KiXnet

Top
#151055 - 2005-11-04 04:49 PM Re: Deleting Default Printer
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Maybe he's just running it on each comp once.
Like said only bippy knows


Edited by Mart (2005-11-04 04:50 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#151056 - 2005-11-04 04:50 PM Re: Deleting Default Printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yup, that must be it.
_________________________
!

download KiXnet

Top
#151057 - 2005-11-04 05:02 PM Re: Deleting Default Printer
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
The plan is something like this...

Code:

if delprinterconnection(GetDefaultPrinter()) = 0
"Default Printer was deleted"
endif


if ingroup ("LibraryPrint")
If ADDPRINTERCONNECTION ("\\print01\Library_4250") = 0
? "Added printer connection...."
endif

If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."
endif
If SetDefaultPrinter ("\\print01\Library_4250") = 0
? "Set default printer to Library_4250...."
endif
endif


if ingroup ("ReceptionPrint")
If ADDPRINTERCONNECTION ("\\print01\Reception") = 0
? "Added printer connection...."
endif

If ADDPRINTERCONNECTION ("\\print01\19E_Copier") = 0
? "Added printer connection...."
endif
If SetDefaultPrinter ("\\print01\Reception") = 0
? "Set default printer to Reception...."
endif
endif


Top
#151058 - 2005-11-04 05:06 PM Re: Deleting Default Printer
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
Is the text on the delete default print command exact? I am getting a failure.
Top
#151059 - 2005-11-04 05:24 PM Re: Deleting Default Printer
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
It is a UDF.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151060 - 2005-11-04 05:36 PM Re: Deleting Default Printer
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
Sorry to be brain dead here, but what is a UDF?
Top
#151061 - 2005-11-04 05:39 PM Re: Deleting Default Printer
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
U = User = YOU
D = Defined = is somewhere in your script
F = Function = like any of the built-ins but in this case YOU DEFINE it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151062 - 2005-11-04 06:19 PM Re: Deleting Default Printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
why you want to delete the default printer connection?
_________________________
!

download KiXnet

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.06 seconds in which 0.025 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