Well, I'm not sure it's the correct way to check for the status of the default printer (if already mapped buy not default), but this seems to work. Get the status of PriMapState and if not equal to 2, SetDefaultPrinter.

code:
;if PriMapState("\\" + $defprinter)<>2 ;does not work

$x=$PriMapstate
if $x<>2
$nul=SetDefaultPrinter("\\" + $defprinter)
? "Status - Default Printer set \\" + $defprinter
? @serror
endif

tjcarst

[ 23. October 2003, 20:40: Message edited by: tjcarst ]