I suspect it's because the month has rolled over to '08' which is treated as an invalid octal number due to the leading zero. This is only a problem when performing some arithmetic.
A way around this is as follows (eg, where %mm% = 08):
set /a mm = 1%mm% + 2 -100
Expanding this gives:
set /a mm = 108 + 2 - 100
therefore:
mm = 10
Which is the correct answer.
Notice we had to put a 1 infront of the %mm% then later, subtract 100.
Main Topics
Browse All Topics





by: kunalapPosted on 2009-08-17 at 03:19:51ID: 25112867
sorry here is the error message we receive:
Invalid number. Numeric constants are either decimal (17), hexadecimal (0x11), or octal (021).
'2' is not recognized as an internal or external command, operable program or batch file.
The system cannot find the file specified.