Invalid number. Numeric constants are either decimal (17), hexadecimal (0x11), or octal (021)

前端 未结 2 1966
情话喂你
情话喂你 2021-01-19 00:18

I wish to execute a batch file and have it call itself 10 times.

set /a iteration=0%1+1
IF %iteration% EQU 10 exit
rem Taskkill /IM aspnet_compiler.exe /F
ti         


        
2条回答
  •  隐瞒了意图╮
    2021-01-19 01:02

    You've got 0%1 in that expression - if your argument is 8, that expands to 08, which isn't a valid octal number (8 is not an octal digit), and so you get that error. I'm not a batch file expert, but I guess you want to leave off the leading 0:

    set /a iteration=%1+1
    

    Here's a link to some SET command documentation.

提交回复
热议问题