control amount of loops (batch file) -


i wondering if there way put limit on loop batch file. mean this: have script:

@echo off :start echo enter password set /p password= if %password%== abcdefg goto correct if not %password%== abcdefg goto start :correct echo job timeout 2 > nul exit :wrong echo wrong timeout 1 > nul exit 

say wanted go through start 3 times, , after that, go wrong. how that?

@echo off setlocal enabledelayedexpansion /l %%a in (1, 1, 3) ( set /p "password=enter password: " if "!password!"=="abcdefg" goto :correct echo wrong, try again timeout /t 1 >nul ) exit :correct echo job timeout /t 2 > nul exit 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -