I'm writing a script to check which domain groups a user is a member of, then check for a .CMD file with the same name as the group to execute if it exists. It's still pretty rough, but I've gotten most of the parsing done. However, the EXIST or even the RUN doesn't seem to properly check for the file or run it.
 Code:
break on
$Index = 0
$ext=".cmd"
$quote = chr(34)

? @LDRIVE
$LDrive = @LSERVER+"\Netlogon\"
? $Ldrive
? @DOMAIN
? LEN(@DOMAIN)

DO
    $DomainGroup = ENUMGROUP($Index)
    $Index = $Index + 1
    IF INSTR($DomainGroup,@DOMAIN)
	$Group = SUBSTR($DomainGroup, LEN(@DOMAIN)+2)
	$Script = $quote+$LDRIVE+$Group+$ext+$quote
	IF EXIST($Script)
		? $Script
		RUN $Script
	ENDIF
    ENDIF
UNTIL Len($DomainGroup) = 0


According to searches, EXIST should have no problem with UNC. I've tried it with and without the quotes to no avail. I'm running it with domain admin privledges to ensure there isn't a permissions snafu causing the issue.

I'm hoping it's something obvious that I'm just not seeing.

Thanks