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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -