@WATTRIB[filename[,-attributes[,p]]]:  If you do not specify any attributes, @WATTRIB returns the attributes of the specified file in the format RHSADECIJNOFTVPU, rather than 0 or 1. If two or more parameters are specified, @WATTRIB returns a 1 if the specified file has the matching attribute(s); otherwise it returns a 0. If the optional third argument ,p is included (partial match), then @WATTRIB will return 1 if any of the attributes match

 

This function is similar to @ATTRIB, but supports file selection based on the following extended attributes available on NTFS volumes.

 

EEncrypted
NNormal
TTemporary
FSparse file
JJunction or symbolic links
LJunction or symbolic links
CCompressed
OOffline
INot content-indexed
VVirtualized
PPinned
UUnpinned

 

Attributes which are not set will be replaced with an underscore. For example, if SECURE.DAT has the read-only, hidden, and archive attributes set, %@WATTRIB[SECURE.DAT] would return RH_A_______. If the file does not exist, @WATTRIB returns an empty string.

 

The attributes (other than N) can be combined (for example %@ATTRIB[MYFILE,HS]). For example, %@WATTRIB[MYFILE,HS,p] will return 1 if MYFILE has the hidden, system, or both attributes. Without ,p the function will return 1 only if MYFILE has both attributes (and no extended attributes).

 

Filename must be in quotes if it contains white space or special characters.

 

See also: Attributes Switches and the ATTRIB command.

 

Examples:

 

echo %@wattrib[tcmd.exe]

___A_____________

 

echo %@wattrib[tcmd.exe,r]

0

 

echo %@wattrib[tcmd.exe,a]

1