Also, you shouldn't be using $exists to check for a non-wildcard, because that matches files *and* folders. For that you should use $isfile. i.e. this returns $true even though it's not a file:

//echo -a $exists(c:\windows\) is true
//echo -a $isfile(c:\windows\) is false