can I ask what you are testing for here:
If $LDRIVE <> $LDR

they are always different, again.
LDR will always have "lokaldrive_" in it and LDRIVE will either be empty or have UNC.
but still they are always different.
_________________________
!

download KiXnet