SET /P IP_INDEX="Please Enter IP index:[1..5]"
if %IP_INDEX% > 5 echo error
I want that if the user choose number grater then 5 it will output you need to choose number between 1 and 5 and print again
Please Enter IP index:[1..5]
Change in script
Moderator: DosItHelp
Re: Change in script
:Label
SET /P IP_INDEX="Please Enter IP index:[1..5]"
if %IP_INDEX% GTR 5 echo you need to choose number between 1 and 5 && GOTO :Label
SET /P IP_INDEX="Please Enter IP index:[1..5]"
if %IP_INDEX% GTR 5 echo you need to choose number between 1 and 5 && GOTO :Label
Re: Change in script
You need also to check that the user don't choose zero
Re: Change in script
And also to check the input is a number and not string or something else
Re: Change in script
mor.bas wrote:You need also to check that the user don't choose zero
Wow!!!! That is pretty demanding. Since when do you tell other people what they need to do.
I gave you the basic logic. I am pretty sure you can figure out how to check if it is Zero.
Re: Change in script
mor.bas wrote:And also to check the input is a number and not string or something else
Anything else you want while you are asking. Maybe I can do other things for you as well. Nobody likes re-writing a script a half dozen times!
