特性如此~- If you use any of the logical or modulus operators, you will need to
- enclose the expression string in quotes. Any non-numeric strings in the
- expression are treated as environment variable names whose values are
- converted to numbers before using them. If an environment variable name
- is specified but is not defined in the current environment, then a value
- of zero is used. This allows you to do arithmetic with environment
- variable values without having to type all those % signs to get their
- values.
复制代码 This allows you to do arithmetic with environment
variable values without having to type all those % signs to get their
values.
set /a a=%a%+1实际执行的是set /a a=+1而不是set /a a=0+1
set /a a=a+1 才是set /a a=0+1,但在for中它是会实时改变的。 |