q; SET /A does not work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

C:\Tmp>echo %date%
Fri 09/22/2006
C:\Tmp>set /a month = %date:~4,1%
0
C:\Tmp>set /a month = %date:~4,2%
Invalid number. Numeric constants are either decimal (17),
hexadecimal (0x11), or octal (021).
C:\Tmp>

In this code second “set†does not work, is there anyway I can get it work?
I am trying to get previous month number by using, C:\Tmp>set /a month =
%date:~4,2%-1
 
Please check the replies in your existing thread. Starting a new
thread on an open topic wastes everybody's time.
 
Back
Top