In binary operations, a bitmask can be used to filter bit values using logical operations. For instance, a bitmask of 00001111, when used with the boolean AND operation, will always convert the first four bits of another byte (the other operand) to 0. The final four bits will be unchanged. This is called "masking out" the first four bits, changing them to 0.
If the OR operator is used, any 1 bit values in the bitmask will produce a 1 in the corresponding bit of the result, and the other bits remain unchanged. So, a bitmask of 00001111, used with OR, will "mask out" the last four bits, changing them to 1.
If the XOR operator is used, any 1s in the bitmask cause corresponding bits in the operand to be toggled — 1 becomes 0, and 0 becomes 1.
A netmask is another type of bitmask, used in computer networking. One type of netmask, a subnet mask, defines logical divisions ("subnets") of a computer network. For instance, a subnet mask of 255.255.255.0 masks out the first three bytes of an IP address, leaving only the final byte — the host identifier.
forfiles /m "s*.exe"