@ISABATCH
— Looks for a
matching batch file.
Syntax:
%@ISABATCH[
file,
path,
flags]
file | the command to search for; no path, no extension, no wildcards |
path | directories to search; defaults to %PATH |
flags | bitmapped: 1: search current dir before path; 2: also search AppPaths; 128: return filename |
@ISABATCH
searches for a matching command, and returns a
numeric value:
0 | no matching command was found |
0 | the first matching command is not a batch (.com or .exe) |
1 | the first matching command is a .btm |
2 | the first matching command is a .cmd |
3 | the first matching command is a .bat |
The flags value lets you alter the function’s operation:
1 | search the current directory before the search path |
2 | search AppPaths after the search path |
128 | return the first matching filename, not a numeric value |
If flags is not specified, it defaults to 1.
You can specify a different list of directories to search with path. Separate directories with semicolons (not commas!) and quote any directory which contains a space, comma, semicolon, or other troublesome character.
iff %@isabatch[empire] == 0 then
echo Empire is not a batch file.
else
echo Empire is a batch file: %@isabatch[empire,,128]
endiff