User should have local admin rights to the machine he/she is logging onto. Doesn't matter who.

The code below doesn't work all the time. It works the first time but when I removed the user from the local admin group and run the script again, it thinks the user is still in the group and will not add. I ran kix32 /f to clear cache with no luck. Any help will be greatly appriciated.

Thanks guys.

IF INGROUP("\\@WKSTA\Administrators")
? "You are a Local Administrator"
ELSE
? "You are NOT a Local Administrator"
shell '%COMSPEC% /C net localgroup administrators /add @userid >NUL 2>NUL'
ENDIF