#147517 - 2005-09-12 11:36 AM
printer add: need help...
|
balafrus
Fresh Scripter
Registered: 2005-09-12
Posts: 33
Loc: Belgium
|
Hi im new on your forum , and noob with Kix...so,i'm suppose to change the printer by the WKS classroom type with the printer...so if a WKS is in classroom 604 , it's suppose to be connected with printer X and if in 705 , printer Y..etc...etc...
Here's an example of the old script and what i change inside , but don't work properly , block at 45% loading...
Finally excuse my english , im from belgium and don't practice too much my english...
Here's the OLD version of my script: Code:
;********imprimantes**************** $Percent =45 $StatusMessage = $statmsg6 Gosub Progress
if $wksType<>"PTP" $defptr="\\PTP"+substr(@DOMAIN,3,4)+$ccmid+$pool+"1\HP LaserJet 2100 Series PCL 6,winspool,Ne00:" writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device",$defptr,"REG_SZ") else $defptr="\\PTP"+substr(@DOMAIN,3,4)+$ccmid+$pool+"1\HP LaserJet 2100 Series PCL 6,winspool,LPT1:" writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device",$defptr,"REG_SZ") endif if @error<>0 $17="Mapping HP Laser" endif if ingroup ("GB-Eleves") select case $pool=0 gosub "Printer_Pool1" case $pool=1 gosub "Printer_Pool2" case $pool=3 gosub "Printer_Pool3" endselect if $wksType="PTE" shell "cmd /c rd d:\temp /s /q" md d:\temp endif $Percent =50 Gosub Progress endif
if ingroup ("GB-Professeurs") Or ingroup ("GB-PersRessources") Or ingroup ("Administrateurs") if $wksType="PTE" or $wksType="PTP" select case $pool=0 gosub "Printer_Pool1" case $pool=1 gosub "Printer_Pool2" case $pool=3 gosub "Printer_Pool3" endselect $Percent =50 Gosub Progress endif if $wksType="PTD" or $wksType="PTM" $laser1="PRL"+substr(@DOMAIN,3,4)+$ccmid+"01" $laser2="PRL"+substr(@DOMAIN,3,4)+$ccmid+"11" $srvQL1="\\PTP"+substr(@DOMAIN,3,4)+$ccmid+"01\"+$laser1 $srvQL2="\\PTP"+substr(@DOMAIN,3,4)+$ccmid+"11\"+$laser2 $srvQL=$srvQL1 gosub "Printer_Pool1" $srvQL=$srvQL2 gosub "Printer_Pool2" $Percent =50 Gosub Progress endif gosub "Printer_Color" $Percent =55 Gosub Progress endif $Percent =60 $StatusMessage = $statmsg7 Gosub Progress
As i need ot connect 5 printer for spécifics classroom , here's what i did: New code: Code:
;********imprimantes**************** $Percent =45 $StatusMessage = $statmsg6 Gosub Progress
if $wksType<>"PTP" $defptr="\\PTP"+substr(@DOMAIN,3,4)+$ccmid+$pool+"1\HP LaserJet 2100 Series PCL 6,winspool,Ne00:" writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device",$defptr,"REG_SZ") else $defptr="\\PTP"+substr(@DOMAIN,3,4)+$ccmid+$pool+"1\HP LaserJet 2100 Series PCL 6,winspool,LPT1:" writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device",$defptr,"REG_SZ") endif if @error<>0 $17="Mapping HP Laser" endif if ingroup ("GB-Eleves") select case $pool=0 gosub "Printer_Pool1" case $pool=1 gosub "Printer_Pool2" case $pool=3 gosub "Printer_Pool3" endselect if $wksType="PTE" shell "cmd /c rd d:\temp /s /q" md d:\temp endif
************ SCRIPT MODIFIE PAR BALAFRUS *********************** if $wksType<>"PTE0604" $defptr="\\PTP7002A01\HP LaserJet 2100 Series PCL 6,winspool,Ne00:" writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device",$defptr,"REG_SZ") endif
if $wksType<>"PTE0605" $defptr="\\PTP7002A11\HP LaserJet 2100 Series PCL 6,winspool,Ne00:" writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device",$defptr,"REG_SZ") endif
if $wksType<>"PTE0705" $defptr="\\PTE0705A06\HP705,winspool,Ne00:" writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device",$defptr,"REG_SZ") endif
if $wksType<>"PTE0706" $defptr="\\PTE0705A06\HP705,winspool,Ne00:" writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device",$defptr,"REG_SZ") endif ***************************************************************
Please excuse me if i make a forum mistake ....im noob...
And if u can bring me to light with this script....thanks a lot !
BAL.
Edited by balafrus (2005-09-12 12:19 PM)
|
Top
|
|
|
|
#147519 - 2005-09-12 01:30 PM
Re: printer add: need help...
|
balafrus
Fresh Scripter
Registered: 2005-09-12
Posts: 33
Loc: Belgium
|
Okay , i think that's what you speak about...scuse me but i don't know anything @ Kix32...
Code:
;********laser 1************************** :Printer_Pool1 if $wkstype="PTP" and $wksorder="01" $statlaser=$loc else if addprinterconnection ($srvQL) = 0 $statlaser=$ok else $statlaser=$abs endif endif $def_print="HP Laser Pool1 "+$statlaser if $statlaser=$ok or $statlaser=$loc $nul = oleputproperty ( $frmprint, "innerhtml", "s", 'color="#FFFF00">$def_print' ) else $nul = oleputproperty ( $frmprint, "innerhtml", "s", 'color="#FF0000">$def_print' ) endif return
;********laser 2************************** :Printer_Pool2 $ptp11="\\PTP"+substr(@DOMAIN,3,4)+$ccmid+"11" shell "net view $ptp11" if @error=0 if $wkstype="PTP" and $wksorder="11" $statlaser=$loc else if addprinterconnection ($srvQL) = 0 $statlaser=$ok else $statlaser=$abs endif endif $def_print="HP Laser Pool2 "+$statlaser if $statlaser=$ok or $statlaser=$loc $nul = oleputproperty ( $frmprint, "innerhtml", "s", 'color="#FFFF00">$def_print' ) else $nul = oleputproperty ( $frmprint, "innerhtml", "s", 'color="#FF0000">$def_print' ) endif else $statlaser=$nex endif return
;********laser 3************************** :Printer_Pool3 $ptp31="\\PTP"+substr(@DOMAIN,3,4)+$ccmid+"31" shell "net view $ptp31" if @error=0 if $wkstype="PTP" and $wksorder="31" $statlaser=$loc else if addprinterconnection ($srvQL) = 0 $statlaser=$ok else $statlaser=$abs endif endif $def_print="HP Laser Pool3 "+$statlaser if $statlaser=$ok or $statlaser=$loc $nul = oleputproperty ( $frmprint, "innerhtml", "s", 'color="#FFFF00">$def_print' ) else $nul = oleputproperty ( $frmprint, "innerhtml", "s", 'color="#FF0000">$def_print' ) endif else $statlaser=$nex endif return
;********couleur************************** :Printer_Color if $wkstype<>"PTP" and $wksorder="21" $statcolor=$loc else if addprinterconnection ($srvQC) = 0 $statcolor=$ok else $statcolor=$abs endif endif $print_2="HP Deskjet "+$statcolor if $statcolor=$ok or $statcolor=$loc $nul = oleputproperty ( $frmprint2, "innerhtml", "s", 'color="#FFFF00">$print_2' ) else $nul = oleputproperty ( $frmprint2, "innerhtml", "s", 'color="#FF0000">$print_2' ) endif return
|
Top
|
|
|
|
#147523 - 2005-09-12 02:00 PM
Re: printer add: need help...
|
balafrus
Fresh Scripter
Registered: 2005-09-12
Posts: 33
Loc: Belgium
|
AD don't exist in NT4 server...my version of KiXtart ? i don't even know...but old i bet...i'm new at my job and just discover that they haven't a right server...and im suppose to do the best with this crappy server and this script... Any idea of what can i do to do what i need ?
BAL. Thx to read me at least
|
Top
|
|
|
|
#147524 - 2005-09-12 02:02 PM
Re: printer add: need help...
|
balafrus
Fresh Scripter
Registered: 2005-09-12
Posts: 33
Loc: Belgium
|
ok i check my KiXtart version , ....hem.... 3.62....sorry...i know it's sooooo old but i'm suppose to do it with what i've got..
BAL.
|
Top
|
|
|
|
#147529 - 2005-09-13 10:13 AM
Re: printer add: need help...
|
balafrus
Fresh Scripter
Registered: 2005-09-12
Posts: 33
Loc: Belgium
|
Well let's try to explain a little bit my situation , i've to manage an NT4 server based network , Kix was installed before my arrival , so i must work with it but i can change to new version if i got a little hand to help me...
The classroom are supposed to be like that:
Class 604: -One laser printer -One colour printer -All post named by the same convention (PTExxxxAxx)
Class 605: -One laser printer -One colour printer -All post named by the same convention (PTExxxxAxx)
Class 705-706 -One colour printer -All post named ...PTExxxxAxx
For all WKS , their names are:
PTE0(local n°)A(machine number)
In ex: PTE0604A01....02...-> 10 Next , PTE0705A01...10...
Am i most clear like this ?
If any help needed , ask me...
Thanks for all your help !
(damn , speaking english is so hard for me... please don't laugh...:p)
BAL.
Edited by balafrus (2005-09-13 10:13 AM)
|
Top
|
|
|
|
#147534 - 2005-09-13 11:50 AM
Re: printer add: need help...
|
balafrus
Fresh Scripter
Registered: 2005-09-12
Posts: 33
Loc: Belgium
|
Here's my first try to connect some network ressources:
Code:
if ingroup("GB-Professeur")
if exist h: goto :exist else Net use h: \\SRV7002A01\Forum ? Forum connecté
if exist i: goto :exist else Net use i: \\SRV7002A01\Prive ? Privé connecté
if exist j: goto :exist else Net use j: \\SRV7002A01\public ?Public connecté
if exist k: goto :exist else Net use k: \\SRV7002A01\eleves ? Eleves connecté
if exist l: goto :exist else Net use l: \\SRV7002A01\bcd ? BCD connecté
ENDIF
if ingroup("domain user")
if exist h: goto :exist else Net use h: \\SRV7002A01\Forum ? Forum connecté
if exist k: goto :exist else Net use k: \\SRV7002A01\eleves ? Eleves connecté
Endif
Am i good ?
BAL.
|
Top
|
|
|
|
#147536 - 2005-09-13 12:14 PM
Re: printer add: need help...
|
balafrus
Fresh Scripter
Registered: 2005-09-12
Posts: 33
Loc: Belgium
|
is
Code:
Use * /delete
used to delete all mappings ?
BAL.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 507 anonymous users online.
|
|
|