How to use the if-else statements in batch programming? -
How to use the if-else statements in batch programming? -
i writing batch code. want take character user , if true set of statements should executed else set of statements.
i tried :
set /p aj= if %aj%==y ( set of commands... ) else ( set of commands... )
but unable perfect output supposed get. please help.
if code script long find using goto
easier. seek this:
set /p "aj=: " if /i "%aj%"=="y" goto :yes :no rem set of commands... goto :post :yes rem set of commands... goto :post :post rem code after if-statement
that way know don't need enabledlayedexpansion
, can have long pieces of code little worry formatting.
batch-file
Comments
Post a Comment