There's some problems with that code:

- You should use * instead of *.* for $findfile() matching - a filename doesn't always contain a period.
- Since you've already declared %x as local there's no need to re-use /var - it's much slower than the %var = value syntax in my experience.
- You shouldn't delimit file/folder lists with commas - both can contain commas themselves.
- %x = %x $gettok($1-,-1,$asc(\)) $+ $chr(44) $+ $chr(32) - The $+ $chr(32) is pointless.
- elseif $prop == folder - Missed the 's' in 'folders'.


Spelling mistakes, grammatical errors, and stupid comments are intentional.