#204554 - 2012-03-23 10:28 PM
delprinterConnection ......Help
|
Chan
Fresh Scripter
Registered: 2011-10-14
Posts: 15
Loc: Arizona
|
Hello all it been a while.. be rackuing my self
I need to delet a few printer via login scrip... the printer have been deleted off our seerver and do not want user trying to print to them. as you can see this can cause phone calls... I can not see why the code is not removing the Key this is on xp, and 7
script below ;******************************************************************************** ;* subroutine to delete OLD printer ;**************************************************************************
if existkey("HKEY_CURRENT_USER\Printers\Connections\,,xxxxxxx,Cannon IR3300 (Copy Room East)=0 $temp=Delprinterconnections("\\xxxxxxx,IR3300 (Copy Room East)") endif
if existkey("HKEY_CURRENT_USER\Printers\Connections\,,xxxxxxx,Cannon IR5050 (Copy Room East)") =0 $temp=Delprinterconnections("\\xxxxxxx,Cannon IR5050 (Copy Room East)") endif
if existkey("HKEY_CURRENT_USER\Printers\Connections\,,xxxxxxx,HP 4Plus (IDF East)") =0 $temp=Delprinterconnections("\\xxxxxxx,HP 4Plus (IDF East)") endif
|
|
Top
|
|
|
|
#204561 - 2012-03-24 03:21 PM
Re: delprinterConnection ......Help
[Re: Lonkero]
|
Chan
Fresh Scripter
Registered: 2011-10-14
Posts: 15
Loc: Arizona
|
yes that was my typo here is the full code corrected.. i basically is looking to do this in the simplist way . for it will only be active when i need to delet or remove a printer from end users machine
;******************************************************************************** ;* subroutine to delete OLD printer ;**************************************************************************
if existkey("HKEY_CURRENT_USER\Printers\Connections\,,xxxxxxx,Cannon IR3300 (Copy Room East")=0 $temp=Delprinterconnection("\\xxxxxxx,IR3300 (Copy Room East)") endif
if existkey("HKEY_CURRENT_USER\Printers\Connections\,,xxxxxxx,Cannon IR5050 (Copy Room East)") =0 $temp=Delprinterconnection("\\xxxxxxx,Cannon IR5050 (Copy Room East)") endif
if existkey("HKEY_CURRENT_USER\Printers\Connections\,,xxxxxxx,HP 4Plus (IDF East)") =0 $temp=Delprinterconnection("\\xxxxxxx,HP 4Plus (IDF East)") endif
|
|
Top
|
|
|
|
#204564 - 2012-03-24 04:13 PM
Re: delprinterConnection ......Help
[Re: Les]
|
Chan
Fresh Scripter
Registered: 2011-10-14
Posts: 15
Loc: Arizona
|
thanks another typo i caught that right after i posted this but test are still the same with printer connection not being deletd.....o the joy of saturday work
|
|
Top
|
|
|
|
#204570 - 2012-03-24 11:18 PM
Re: delprinterConnection ......Help
[Re: Lonkero]
|
Chan
Fresh Scripter
Registered: 2011-10-14
Posts: 15
Loc: Arizona
|
Ok .. so this is where we are and what i am working with.. i have been gevin teh task of getting this to work win xp win 7 enviroment run kix 4.61 teh Idea is something that we can add to in future since later this year we plaine on up gradding 75 printer in one weekend ....... o not looking forward to that.
if existkey("HKEY_CURRENT_USER\Printers\Connections\,,server1,Cannon IR3300 (Copy Room East)") = 0
? "Deleting Cannon IR3300 (Copy Room East) printer" $temp=delprinterconnection("\\serever1,Cannon IR5050 (Copy Room East)") ? "Cannon IR3300 (Copy Room East) printer deleted" else ? "Cannon IR3300 (Copy Room East) printer already deleted." endif if existkey("HKEY_CURRENT_USER\Printers\Connections\,,Server1,Cannon IR5050 (Copy Room East)") = 0
? "Deleting Cannon IR5050 (Copy Room East) printer" $temp=delprinterconnection("\\Server1,cannon IR5050 (Copy Room East)") ? "Cannon IR5050 (Copy Room East) printer deleted" else ? "Cannon IR5050 (Copy Room East) printer already deleted." endif if existkey("HKEY_CURRENT_USER\Printers\Connections\,,Server1,HP4Plus (IDF East)") = 0
? "Deleting HP4Plus (Copy Room East) printer" $temp=delprinterconnection("\\Server1,HP4Plus (IDF East)") ? "HP4Plus (IDF East) printer deleted" else ? "HP4Plus (IDF East) printer already deleted." endif
|
|
Top
|
|
|
|
#204572 - 2012-03-25 12:59 AM
Re: delprinterConnection ......Help
[Re: Les]
|
Chan
Fresh Scripter
Registered: 2011-10-14
Posts: 15
Loc: Arizona
|
I just read that thank you for that catch yes it will need the wak"\" as for the speeling the names have all been changes as i do not wat to post anyof that on the web in my scrip it is currect.... Will update my scrip in a few hours and test... But i tink the Wak wehre the issue... will reply after test
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(mole)
and 494 anonymous users online.
|
|
|