also:
code:
CASE
$nptr='' AND EXIST($ps)
$lpt1=READPROFILESTRING($ps,'Printers','Default')
$rc=ADDPRINTERCONNECTION($lpt1)
$rc=SETDEFAULTPRINTER($lpt1)
USE LPT1: $lpt1 /persistent
;Ref. - http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=006790
;Thanks Doc for the ideas and Lonkero for the fixes!
FOR EACH $key IN split(readprofilestring($ps,'Printers',''),chr(10))
IF $key<>'Default'
$nul=addprinterconnection(readprofilestring($ps,'Printers',$key))
ENDIF
NEXT
is just the same as:
code:
CASE
$nptr='' AND EXIST($ps)
FOR EACH $key IN split(readprofilestring($ps,'Printers',''),chr(10))
$nul=addprinterconnection(readprofilestring($ps,'Printers',$key))
NEXT
$rc=SETDEFAULTPRINTER(READPROFILESTRING($ps,'Printers','Default'))
USE LPT1: $lpt1 /persistent