I was forgotten an example. It gives you an idee what the result can be.

code:

[SPLNX000_NT]
'NONE' mca SPLNX000_NT=00119_000428_14:21:51 spld59672 (NT - vs 3.61 L SPLNX000 \\FD71002) 171.021.093.100 00A024A835EF MCA SPLD59672
'\\FD71001\NO01' nomaint SPLNX000_NT=00119_000428_15:34:48 spld59264 (NT - vs 3.61 L SPLNX000 \\FD71002) 171.021.051.245 00104BB919A2 nomaint SPLD59264

[SPLNX000_95]
'\\FD71001\No03' 'NO03_HP_LJ_5M' no01sf SPLNX000_95=00119_000428_14:59:52 wd57550 (95 - vs 3.61 L SPLNX000 \\FD71002) 171.021.064.057 4000D700E557 NO01SF WD57550
'\\Fd71001\no02' 'HP LaserJet 4MP' no01js SPLNX000_95=00119_000428_15:01:31 wd46027 (95 - vs 3.61 L SPLNX000 \\FD71002) 171.021.064.050 4000D700E550 NO01JS WD46027
'\\FD71001\No03' 'HP LaserJet 5MP' no01rg SPLNX000_95=00119_000428_15:19:09 wd46096 (95 - vs 3.61 L SPLNX000 \\FD71002) 171.021.064.044 4000D700E544 NO01RG WD46096
'\\Fd71001\no02' 'HP LaserJet 4MP LAN' no01rh SPLNX000_95=00119_000428_15:31:26 wd59746 (95 - vs 3.61 L SPLNX000 \\FD71002) 171.021.064.032 4000D700E532 NO01RH WD59746
LPT1: 'HP LaserJet 4000 PCL 6 LOCAL' no01pv SPLNX000_95=00119_000428_15:26:10 wd46028 (95 - vs 3.61 L SPLNX000 \\FD71002) 171.021.064.029 4000D700E529 NO01PV WD46028
'\\Fd71001\no05' 'HP DeskJet 895C Series Printer' no01th SPLNX000_95=00119_000428_17:01:50 wd46025 (95 - vs 3.61 L SPLNX000 \\FD71002) 171.021.064.051 4000D700E551 NO01TH WD46025


Following piece of code can create a list of all LOCAL connected printers. Based on calculated variables earlier in script.

code:

; - $default_printer (previously calculated) -
; - $default_port (previously calculated) -
; - $temp (previously calculated) f.e. (NT - vs 3.61 L SPLNX000 \\FD71002) 171.021.093.100 00A024A835EF MCA
; - $debug_mode (set earlier)
; - $domain (previously calculated) f.e. SPLNX000
; - $key (set earlier) f.e. 00119_000428_15:34:48
; - $user (previously calculated) f.e. MCA
;
$file="X:\info\local.lst"
IF ($NT_mode = "yes")
$section_x=$domain+"_NT"
ELSE
$section_x=$domain+"_95"
ENDIF
$key_x=substr(LCASE($user) +" ",1,15)+" "
$key_x=$key_x+$section_x
$xxx=""
IF (INSTR(LCASE($default_port),"lpt") <> 0)
$xxx=$xxx+substr($key,1,22)
$xxx=$xxx+substr(LCASE(@wksta)+" ",1,15)+" "
$xxx=$xxx+substr($defprt+" ",1,55)+" "
$xxx=$xxx+$tmp
ENDIF
;
IF ($debug_mode = "yes")
?
? " file_y = "+$file_y
? " section_x = "+$section_x
? " key_x = "+$key_x
? " xxx = "+$xxx
? " default_prt = "+$default_printer
? " port "+$default_port
? " defprt = "+$defprt
?
ENDIF
IF writeprofilestring($file, $section_x, $key_x, $xxx)
ENDIF


Greetings

[This message has been edited by MCA (edited 01 May 2000).]

_________________________
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