batch command input menu -


i have question . possible make batch menu accept multiple commands @ same time?

example : ( code )

@echo off  set tries=6 :top cls set /a tries=%tries% -1 if %tries%==0 ( goto penalty ) echo have %tries% attempts left. echo please enter password proceed set /p password= if %password%==parola ta ( echo welcome name ping localhost -n 5 >nul cls echo connected!    c: cd\ cls  :menu cls  echo  ============= menu name ============= echo ------------------------------------- echo 1.  system information txt file echo 2.  selection 2 echo 3.  selection 3 echo 4.  selection 4 echo 5.  selection 5 echo 6.  selection 6 echo 7.  selection 7 echo ------------------------------------- echo 8.  selection 8 echo ------------------------------------- echo 9.  selection 9 echo ------------------------------------- echo ==========press 'q' quit========== echo.  set input= set /p input=please select number:  if /i '%input%'=='1' goto selection1 if /i '%input%'=='2' goto selection2 if /i '%input%'=='3' goto selection3 if /i '%input%'=='4' goto selection4 if /i '%input%'=='5' goto selection5 if /i '%input%'=='6' goto selection6 if /i '%input%'=='7' goto selection7 if /i '%input%'=='8' goto selection8 if /i '%input%'=='9' goto selection9 if /i '%input%'=='q' goto quit  cls  echo ============invalid input============ echo ------------------------------------- echo please select number main echo menu [1-9] or select 'q' quit. echo ------------------------------------- echo ======press key continue======  pause > nul goto menu  :selection1  systeminfo.exe>systeminfo.txt  echo ============invalid input============ echo ------------------------------------- echo please select number main echo menu [1-9] or select 'q' quit. echo ------------------------------------- echo ======press key continue======  pause > nul goto menu   :selection2  call cleanup.bat  :selection3  , in here too...  :selection4  , on  :selection5  , on  :selection6  , on  :selection7  , on  :selection8  , on  :selection9  , on  :quit cls  echo ==============thankyou=============== echo ------------------------------------- echo ======press key continue======  pause>nul exit  pause cls ) else ( goto top ) goto top 

how make program accept more 1 command? example 1,3,5 execute in same time?

or question, how possible undo .exe .bat? there such program?

suggestion: make call goto , concatenate commands &:

 if /i '%input%'=='1' goto:selection1 if /i '%input%'=='2' call:selection2&call:selection2&call:selection4 if /i '%input%'=='3' call:selection3&call:selection3 if /i '%input%'=='4' call:selection4&call:selection4 if /i '%input%'=='5' call:selection5 if /i '%input%'=='6' call:selection6 if /i '%input%'=='7' call:selection7 if /i '%input%'=='8' call:selection8 if /i '%input%'=='9' call:selection9 if /i '%input%'=='q' goto:quit 

to work must alse add goto:eof (eof=end of file) after jump labels, eg.:

 :selection2 call cleanup.bat goto:eof  :selection3 , in here too... goto:eof  :selection4 , on goto:eof  :selection5 , on goto:eof ... .. . 

goto:eof returns control main program.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -