我有下面的代碼,我喜歡重複基於輸入Y中的過程在該行:Windows批處理循環如何?
REM若低於值Y,重複上述過程 SET/P重複=做你想要做其他相同系統?:
如何使用LOOP來做到這一點?
@ECHO OFF
:: List of Systems as Vairable
set "SB1=hannlsb1.mydomain.com:30515 -i 05"
set "DB1=hannlsd2.mydomain.com:31315 -i 13"
set "QB1=hannlsqa1-1:30115 -i 01"
set "DB0=hannlsd1.mydomain.com -i 10"
set "QB0=hannlsps1-1.mydomain.com-i 03"
set "WB1=hannlsqa1-1:30315 -i 03"
set "VB1=hannlsvt-1.mydomain.com -i 01"
SET /P isid=Please enter isid:
SET /P pass=Please enter password to be reset:
REM NEED LOOP Here
SETLOCAL ENABLEDELAYEDEXPANSION
SET /P sysid=Please enter SystemID:
FOR /F "usebackq delims==" %%i IN (`echo+!%sysid%!`) DO SET val=%%i
SETLOCAL DISABLEDELAYEDEXPANSION
IF NOT "%val%"=="" (
REM ECHO Hello %sysid%, Welcome to DOS inputs!
ECHO %val%
REM If value below is Y, repeat the process
SET /P repeat=do you want to do the same for other systems ?:
) ELSE (
ECHO You did not enter Correct System ID! Bye bye!!
)
pause