Page 2 of 2 <12
Topic Options
#62875 - 2002-02-10 03:16 PM Re: PRINTER DEFINITION BY WORKSTATION
sue potts Offline
Fresh Scripter

Registered: 2002-02-07
Posts: 7
Didnt work tryed both ways adding to group then at the start of my script Im getting an error message and I cant print at all
???????

Top
#62876 - 2002-02-10 10:54 PM Re: PRINTER DEFINITION BY WORKSTATION
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Achoo!!

Which thread are we working on here??
http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=2&t=002941

Are these the same? This is getting too confusing.

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#62877 - 2002-02-11 05:55 AM Re: PRINTER DEFINITION BY WORKSTATION
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We review your script and we have some remarks about:

  • GOSUBs not necessary. earlier mention by others.
  • the use of "USE X: /del" not consistent. we insert in our version
    an "USE X: /del" before using "USE X: "\\server\share"".
  • your are referencing twice to L-drive in "SCHOOL STAFF" part.
  • your are referencing to Z-drive in "DOMAIN ADMINS" part. we advice you
    not to use the Z-drive. it has special meanings in windows environment.
  • we are using INGROUP("...") <> 0 instead of INGROUP("...") = 1,
    which work for all kixtart releases

Our version:

code:

IF InGroup ("cohort99_00") <> 0
USE u: /del
USE u: "\\Utility-server\99"
ENDIF
IF InGroup ("cohort97_98") <> 0
USE u: /del
USE u: "\\Utility-server\97"
ENDIF
IF InGroup ("cohort98_99") <> 0
USE u: /del
USE u: "\\Utility-server\98"
ENDIF
IF InGroup ("cohort00") <> 0
USE u: /del
USE u: "\\Utility-server\00"
ENDIF
IF InGroup ("cohort01") <> 0
USE u: /del
USE u: "\\Utility-server\01"
ENDIF
IF InGroup ("school staff") <> 0
USE k: /del
USE l: /del
USE m: /del
USE n: /del
USE o: /del
USE r: /del
USE k: "\\Utility-server\kudos"
USE l: "\\Utility-server\careerscape"
;USE l: "\\curriculum\rivers"
USE m: "\\admin-server\y72001"
USE n: "\\admin-server\y92001"
USE o: "\\Utility-server\shared"
USE r: "\\admin-server\reports"
ENDIF
IF InGroup ("students") <> 0
USE g: /del
USE i: /del
USE k: /del
USE l: /del
USE m: /del
USE o: /del
USE r: /del
USE s: /del
USE t: /del
USE g: "\\Utility-server\itskills"
USE i: "\\cdromserver\sschool"
USE k: "\\Utility-server\kudos"
USE l: "\\curriculum\rivers"
USE m: "\\Utility-server\omnigraph"
USE o: "\\Utility-server\shared"
USE r: "\\Utility-server\roa$"
USE s: "\\Utility-server\careerscape"
ENDIF
IF InGroup ("domain admins") <> 0
;;run "\\Utility-server\shared\ranger\setup.exe"
USE i: /del
USE p: /del
USE r: /del
USE t: /del
USE z: /del
USE i: "\\cdromserver\sschool"
USE p: "\\cdromserver\office97"
USE r: "\\admin-server\reports"
USE t: "\\cdromserver\quickcad"
USE z: "\\backup server\cdrom"
ENDIF
IF InGroup ("sims") <> 0
USE s: /del
USE s: "\\admin-server\applicat"
ENDIF
IF InGroup ("Food") <> 0
USE p: /del
USE p: "\\cdromserver\the can"
ENDIF
IF InGroup ("PrimarySchool") <> 0
USE o: /del
USE o: "\\Utility-server\shared"
ENDIF
GOSUB set_printers
EXIT
:set_printers
$sroom=Substr(@wksta,1,2) ; Room Prefix Tx
$ipcno=Substr(@wksta,3,9) ; Simple sequential PC number.
"This is PC number " $ipcno " in room number " $sroom ?
SELECT
CASE $sroom = "T8"
USE lpt1: "\\curriculum\T8Colour"
USE lpt2: "\\curriculum\Pagepro4100"
CASE $sroom = "T9"
USE lpt1: "\\curriculum\T9colour"
USE lpt2: "\\curriculum\T9black"
CASE $sroom = "T7"
USE lpt1: "\\curriculum\T7Colour"
USE lpt2: "\\curriculum\T7black"
CASE 1
? "No printer mapped - room not recognised"
ENDSELECT
RETURN

Also we have create a version with additional debugging code

code:

CLS
COLOR C+/N
AT (1,1) " "
IF RedirectOutput("c:\kixdebug.txt")
ENDIF
? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/3.00e script starting."
? "-"
? "-curdir: "+LCASE(@curdir)
? "-scriptdir: "+LCASE(@scriptdir)
? "-startdir: "+LCASE(@startdir)
? "-"
? "-userid: "+LCASE(@userid)+"/"+LCASE(@wuserid)
? "-user priv: "+LCASE(@priv)
? "-version: inwin="+@inwin+"/dos="+@dos
? "-"

?"- 1-"+@time+"- @error @serror "? IF InGroup ("cohort99_00") <> 0
?"- 2-"+@time+"- @error @serror "? USE u: /del
?"- 3-"+@time+"- @error @serror "? USE u: "\\Utility-server\99"
?"- 4-"+@time+"- @error @serror "? ENDIF
?"- 5-"+@time+"- @error @serror "? IF InGroup ("cohort97_98") <> 0
?"- 6-"+@time+"- @error @serror "? USE u: /del
?"- 7-"+@time+"- @error @serror "? USE u: "\\Utility-server\97"
?"- 8-"+@time+"- @error @serror "? ENDIF
?"- 9-"+@time+"- @error @serror "? IF InGroup ("cohort98_99") <> 0
?"- 10-"+@time+"- @error @serror "? USE u: /del
?"- 11-"+@time+"- @error @serror "? USE u: "\\Utility-server\98"
?"- 12-"+@time+"- @error @serror "? ENDIF
?"- 13-"+@time+"- @error @serror "? IF InGroup ("cohort00") <> 0
?"- 14-"+@time+"- @error @serror "? USE u: /del
?"- 15-"+@time+"- @error @serror "? USE u: "\\Utility-server\00"
?"- 16-"+@time+"- @error @serror "? ENDIF
?"- 17-"+@time+"- @error @serror "? IF InGroup ("cohort01") <> 0
?"- 18-"+@time+"- @error @serror "? USE u: /del
?"- 19-"+@time+"- @error @serror "? USE u: "\\Utility-server\01"
?"- 20-"+@time+"- @error @serror "? ENDIF
?"- 21-"+@time+"- @error @serror "? IF InGroup ("school staff") <> 0
?"- 22-"+@time+"- @error @serror "? USE k: /del
?"- 23-"+@time+"- @error @serror "? USE l: /del
?"- 24-"+@time+"- @error @serror "? USE m: /del
?"- 25-"+@time+"- @error @serror "? USE n: /del
?"- 26-"+@time+"- @error @serror "? USE o: /del
?"- 27-"+@time+"- @error @serror "? USE r: /del
?"- 28-"+@time+"- @error @serror "? USE k: "\\Utility-server\kudos"
?"- 29-"+@time+"- @error @serror "? USE l: "\\Utility-server\careerscape"
?"- 30-"+@time+"- @error @serror "? ;USE l: "\\curriculum\rivers"
?"- 31-"+@time+"- @error @serror "? USE m: "\\admin-server\y72001"
?"- 32-"+@time+"- @error @serror "? USE n: "\\admin-server\y92001"
?"- 33-"+@time+"- @error @serror "? USE o: "\\Utility-server\shared"
?"- 34-"+@time+"- @error @serror "? USE r: "\\admin-server\reports"
?"- 35-"+@time+"- @error @serror "? ENDIF
?"- 36-"+@time+"- @error @serror "? IF InGroup ("school students") <> 0
?"- 37-"+@time+"- @error @serror "? USE g: /del
?"- 38-"+@time+"- @error @serror "? USE i: /del
?"- 39-"+@time+"- @error @serror "? USE k: /del
?"- 40-"+@time+"- @error @serror "? USE l: /del
?"- 41-"+@time+"- @error @serror "? USE m: /del
?"- 42-"+@time+"- @error @serror "? USE o: /del
?"- 43-"+@time+"- @error @serror "? USE r: /del
?"- 44-"+@time+"- @error @serror "? USE s: /del
?"- 45-"+@time+"- @error @serror "? USE t: /del
?"- 46-"+@time+"- @error @serror "? USE g: "\\Utility-server\itskills"
?"- 47-"+@time+"- @error @serror "? USE i: "\\cdromserver\sschool"
?"- 48-"+@time+"- @error @serror "? USE k: "\\Utility-server\kudos"
?"- 49-"+@time+"- @error @serror "? USE l: "\\curriculum\rivers"
?"- 50-"+@time+"- @error @serror "? USE m: "\\Utility-server\omnigraph"
?"- 51-"+@time+"- @error @serror "? USE o: "\\Utility-server\shared"
?"- 52-"+@time+"- @error @serror "? USE r: "\\Utility-server\roa$"
?"- 53-"+@time+"- @error @serror "? USE s: "\\Utility-server\careerscape"
?"- 54-"+@time+"- @error @serror "? ENDIF
?"- 55-"+@time+"- @error @serror "? IF InGroup ("domain admins") <> 0
?"- 56-"+@time+"- @error @serror "? ;;run "\\Utility-server\shared\ranger\setup.exe"
?"- 57-"+@time+"- @error @serror "? USE i: /del
?"- 58-"+@time+"- @error @serror "? USE p: /del
?"- 59-"+@time+"- @error @serror "? USE r: /del
?"- 60-"+@time+"- @error @serror "? USE t: /del
?"- 61-"+@time+"- @error @serror "? USE z: /del
?"- 62-"+@time+"- @error @serror "? USE i: "\\cdromserver\sschool"
?"- 63-"+@time+"- @error @serror "? USE p: "\\cdromserver\office97"
?"- 64-"+@time+"- @error @serror "? USE r: "\\admin-server\reports"
?"- 65-"+@time+"- @error @serror "? USE t: "\\cdromserver\quickcad"
?"- 66-"+@time+"- @error @serror "? USE z: "\\backup server\cdrom"
?"- 67-"+@time+"- @error @serror "? ENDIF
?"- 68-"+@time+"- @error @serror "? IF InGroup ("sims") <> 0
?"- 69-"+@time+"- @error @serror "? USE s: /del
?"- 70-"+@time+"- @error @serror "? USE s: "\\admin-server\applicat"
?"- 71-"+@time+"- @error @serror "? ENDIF
?"- 72-"+@time+"- @error @serror "? IF InGroup ("Food") <> 0
?"- 73-"+@time+"- @error @serror "? USE p: /del
?"- 74-"+@time+"- @error @serror "? USE p: "\\cdromserver\the can"
?"- 75-"+@time+"- @error @serror "? ENDIF
?"- 76-"+@time+"- @error @serror "? IF InGroup ("PrimarySchool") <> 0
?"- 77-"+@time+"- @error @serror "? USE o: /del
?"- 78-"+@time+"- @error @serror "? USE o: "\\Utility-server\shared"
?"- 79-"+@time+"- @error @serror "? ENDIF
?"- 80-"+@time+"- @error @serror "? GOSUB set_printers
?"- 81-"+@time+"- @error @serror "? EXIT
?"- 82-"+@time+"- @error @serror "? :set_printers
?"- 83-"+@time+"- @error @serror "? $sroom=Substr(@wksta,1,2) ; Room Prefix Tx
?"- 84-"+@time+"- @error @serror "? $ipcno=Substr(@wksta,3,9) ; Simple sequential PC number.
?"- 85-"+@time+"- @error @serror "? "This is PC number " $ipcno " in room number " $sroom ?
?"- 86-"+@time+"- @error @serror "? SELECT
?"- 87-"+@time+"- @error @serror "? CASE
$sroom = "T8"
?"- 88-"+@time+"- @error @serror "? USE lpt1: "\\curriculum\T8Colour"
?"- 89-"+@time+"- @error @serror "? USE lpt2: "\\curriculum\Pagepro4100"
?"- 90-"+@time+"- @error @serror "? CASE
$sroom = "T9"
?"- 91-"+@time+"- @error @serror "? USE lpt1: "\\curriculum\T9colour"
?"- 92-"+@time+"- @error @serror "? USE lpt2: "\\curriculum\T9black"
?"- 93-"+@time+"- @error @serror "? CASE
$sroom = "T7"
?"- 94-"+@time+"- @error @serror "? USE lpt1: "\\curriculum\T7Colour"
?"- 95-"+@time+"- @error @serror "? USE lpt2: "\\curriculum\T7black"
?"- 96-"+@time+"- @error @serror "? CASE
1
?"- 97-"+@time+"- @error @serror "? ? "No printer mapped - room not recognised"
?"- 98-"+@time+"- @error @serror "? ENDSELECT
?"- 99-"+@time+"- @error @serror "? RETURN

?"- end-"+@time+"- @error @serror "?
? "-"
? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/3.00e script ending."
? "-"
;($begin)
;
; mon 11-feb-2002 04:26:13 (kix 4.00 vs 3.00e)
;
;Informative KIXSTRIP: no errors found (input=99 output=99 skip=0).
;
;Summary KIXSTRIP: block structures
; - do:until [0:0]
; - for|each:in|to:step|next [0|0:0|0:0|0]
; - function:endfunction [0:0]
; - if:else:endif [11:0:11]
; - select:case:endselect [1:4:1]
; - while:loop [0:0]
;Informative KIXSTRIP: 12 block_structures found.
;Informative KIXSTRIP: no UDF's found.
;Informative KIXSTRIP: 1 label found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;Informative KIXSTRIP: 1 EXIT
;Informative KIXSTRIP: 1 GOSUB
;Informative KIXSTRIP: 1 RETURN
;Informative KIXSTRIP: 61 USE
;
;($end)



When you have still problems: please run our debug version and put the output
of file C:\KIXDEBUG.TXT on the board.
greetings.


btw: debugging was added with kix400strip input.kix output.kix /debug.
the kix400strip.exe program can be find on our site.

btw: we first read the topic on forum 2-2940

btw: keep it clear and use only one member name for same problems. also
doesn't enter a topic only once on one forum. it prevent other readers
from missing some replies for others.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#62878 - 2002-02-11 09:35 PM Re: PRINTER DEFINITION BY WORKSTATION
sue potts Offline
Fresh Scripter

Registered: 2002-02-07
Posts: 7
Thanks
I'll try it

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 918 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.053 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

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