Hi there
Easter Monday and i shouldn't be at work (school) but i've an annoying issue regarding why a local printer is not showing as being the default printer (which is what i want). Can anyone help me please?

My log-on script contains the following function:
Function Printers()
; ### remove old network printer connections ###
DelPrinterConnection ("")

; ###set default printer ###
$RegDefaultPrinter=ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device")

If $PCrecord[0,8]<>''
If $RegDefaultPrinter <> ''
If AddPrinterConnection($PCrecord[0,8]) <> 0
DbgMessage("Error"," - can't add " + $PCrecord[0,8])
EndIf
Else
If AddPrinterConnection($PCrecord[0,8]) <> 0
DbgMessage("Error"," - can't add " + $PCrecord[0,8])
EndIf
If SetDefaultPrinter($PCrecord[0,8]) <> 0
DbgMessage("Error"," - can't set default printer")
EndIf
EndIf
EndIf
; ### add rest of printers ###
For $printer = 9 to 12
If $PCrecord[0,$printer]<>""
If AddPrinterConnection($PCrecord[0,$printer]) <> 0
DbgMessage("Error"," - can't add " + $PCrecord[0,$printer])
EndIf
EndIf
Next
EndFunction

Network printers are read from fields 8 - 12 in a DB call. My workstations are tied down and are all W2000.

1: $RegDefaultPrinter always shows as an empty string

2: with no network printer settings, the locally attached printer does not show as the default i.e not ticked.

3: with field 8 empty but 9-12 containing values, the first network printer is selected as the default printer i.e ticked.

4. no errors are reported in my error log file.

Puzzled to say the least.