Code could do with a bit of a tidy up, and contains a subtle bug which may or may not cause you problems.

Try this (untested - I don't have any entries in the reg key):
Code:
Break ON

$=SetOption("Explicit","ON")
$=SetOption("WrapAtEOL","ON")

Function Lpt1Printer()
Dim $iIndex,$sPrinter,$sPort
Dim $PRINTERKEY

$PRINTERKEY="HKLM\System\CurrentControlSet\control\Print\Printers"
$iIndex=0

$sPrinter = EnumKey($PRINTERKEY,$iIndex)
While Not @ERROR AND $sPrinter
"Printer: "+$sPrinter+@CRLF
$sPort = ReadValue($PRINTERKEY+$sPrinter,"Port")
If @ERROR=0 AND $sPort
" Port: "+$sPort+@CRLF
If InStr($sPort,"LPT1")
" LPT1 found, setting default"+@CRLF
If SetDefaultPrinter($sPrinter)
" Error setting default printer: "+@ERROR+", "+@SERROR+@CRLF
$Lpt1Printer=@ERROR
Exit $Lpt1Printer
Else
" Default printer set ok!"+@CRLF
$Lpt1Printer=0
Exit $Lpt1Printer
EndIf
EndIf
EndIf
$iIndex=$iIndex+1
$sPrinter = EnumKey($PRINTERKEY,$iIndex)
Loop
; Set exit and error values to "not found"
$Lpt1Printer=2
Exit $Lpt1Printer
EndFunction

If Lpt1Printer()=0
"LPT1: found, don't look for network printers."+@CRLF
Else
"LPT1: Not found, reason: "+@SERROR+@CRLF
"Set network printer here..."+@CRLF
EndIf