#133750 - 2005-02-14 07:34 PM
DelPrinterConection - Installs Drivers if Printer Not There
|
JackDobiash
Lurker
Registered: 2005-02-14
Posts: 3
Loc: Grand Ronde, OR
|
Greetings! I have a question regarding the DelPrinterConnection function. It works fine to remove the printers, but I have found out that if the printer it is trying to remove is not already installed on their workstation, it Installs the driver. This is causing some issues, including slowing the machine down on login (at least the first time) since it's copying 30+ printer drivers onto their computers. Is there anyway to prevent this from happening, or a way to check to see if it is installed first before trying to remove it? Thanks!
|
|
Top
|
|
|
|
#133752 - 2005-02-15 02:32 AM
Re: DelPrinterConection - Installs Drivers if Printer Not There
|
JackDobiash
Lurker
Registered: 2005-02-14
Posts: 3
Loc: Grand Ronde, OR
|
I found a workaround. Someone made a UDF which checks to see if the printer exists, so I just slimmed it down for my specific environment:
Function DeletePrinter($_Pri) If Len(ReadValue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Devices",$_Pri)) DelPrinterConnection($_Pri) endif endfunction
Thanks!
|
|
Top
|
|
|
|
#133753 - 2005-02-15 04:04 AM
Re: DelPrinterConection - Installs Drivers if Printer Not There
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
someone eh!.. without looking up the code, my guess it was Lonkero
|
|
Top
|
|
|
|
#133755 - 2005-02-15 08:52 AM
Re: DelPrinterConection - Installs Drivers if Printer Not There
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
One thing about driver removal.. You could use the following code. It is more or less a proof of concept and probably needs to be tuned a bit.. If memory serves, the idea comes from how to remove print drivers for NT4.
Delete/Refresh Print Drivers
Kent
|
|
Top
|
|
|
|
#133756 - 2005-02-15 05:49 PM
Re: DelPrinterConection - Installs Drivers if Printer Not There
|
JackDobiash
Lurker
Registered: 2005-02-14
Posts: 3
Loc: Grand Ronde, OR
|
Quote:
someone eh!.. without looking up the code, my guess it was Lonkero
Yeah, it was from Function PriMapState by Lonkero. I didn't need the stuff regarding Win9x and also didn't need to know if it was the Default printer, and didn't need to check if it was in Windows since it's ran through GPO. All it does now is just check to see if the printer is already installed before attemping to delete it.
The only drawback is, you can't use the sharename of the printer, you have to put its FULL name in, since that is how it is stored in the Registry.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 580 anonymous users online.
|
|
|