As you've stated there's no problem using another variable, you can do it as follows (My environment settings use a different substring)

```
set /a "yearminus1=%date:~6,10%-1"
```

For you, I assume this will be `set /a "yearminus1=%date:~10,4%-1"`

, but I can't test this.

Using the `/a`

switch with `set`

specifies you will be giving an expression to be evaluated, rather than just store the expression in the variable as it is.

The following operators can be used:

```
+ Add set /a "_num=_num+5"
+= Add variable set /a "_num+=5"
- Subtract (or unary)set /a "_num=_num-5"
-= Subtract variable set /a "_num-=5"
* Multiply set /a "_num=_num*5"
*= Multiply variable set /a "_num*=5"
/ Divide set /a "_num=_num/5"
/= Divide variable set /a "_num/=5"
% Modulus set /a "_num=5%%2"
%%= Modulus set /a "_num%%=5"
! Logical negation 0 (FALSE) ⇨ 1 (TRUE) and any non-zero value (TRUE) ⇨ 0 (FALSE)
~ One's complement (bitwise negation)
& AND set /a "_num=5&3" 0101 AND 0011 = 0001 (decimal 1)
&= AND variable set /a "_num&=3"
| OR set /a "_num=5|3" 0101 OR 0011 = 0111 (decimal 7)
|= OR variable set /a "_num|=3"
^ XOR set /a "_num=5^3" 0101 XOR 0011 = 0110 (decimal 6)
^= XOR variable set /a "_num=^3"
<< Left Shift. (sign bit ⇨ 0)
>> Right Shift. (Fills in the sign bit such that a negative number always remains negative.)
Neither ShiftRight nor ShiftLeft will detect overflow.
<<= Left Shift variable set /a "_num<<=2"
>>= Right Shift variable set /a "_num>>=2"
( ) Parenthesis group expressions set /a "_num=(2+3)*5"
, Commas separate expressions set /a "_num=2,_result=_num*5"
```

From here.

`(Get-Date).year -1`

simple and clear. gotta love powershell. put it into a variable for further use. – SimonS Feb 12 '16 at 18:24