Nice find Glenn... barely tested but... here it is in UDF form.

Someone care to verify it works?

if logonmode()
  ? "logonmode"
else
  ? "other mode"
endif
 
function logonmode() $logonmode=iif(InStr(Split('%PATH%', ';')[0], 'NetLogon'),1,0) endfunction