How to make a batch file with a message-menu, where 1 = example: launch one application (or site), 2 = launch another one.
- @Harry, According to the rules of the forum, please specify what you did yourself and what did not work out. - Vfvtnjd
- I make my 1 program for cmd I did it (more precisely, everything except functions (so if I clicked on a site, etc., etc., etc.)) I did not try, I do not understand what command is needed for this - Harry
- oneYou to start, at least some basics go . Then, it is possible that you yourself can fight. - Deonis
- thanks for the link I will learn - harry
|
2 answers
No need to reinvent the wheel. Starting in windows xp, there is a choice command allowing the user to make a choice.
See choice /?
The result of the selection is stored in the variable% errorlevel%
- It will probably be useful to know more about timeout /? And that is, lovers pause via ping localhost -n 5> nul :-) :-) - pincher1519
|
Hold code :)
@Echo Off :X_LOOP Set /P $X=Make Your Choice Padavan!: (1 - ya.ru; 2 - calc; n - exit)? (1/2/n): If /I Not "%$X%"=="1" If /I Not "%$X%"=="2" If /I Not "%$X%"=="n" GoTo X_LOOP If /I "%$X%"=="1" CMD /c "%PROGRAMFILES%/Internet Explorer/iexplore.exe" ya.ru If /I "%$X%"=="2" CMD /c calc.exe If /I "%$X%"=="n" Exit 1 Echo Done! PAUSE
- Are you going to program all your life for a top-starter? He will not learn anything like that. It would be better to chew the main teams. - VladD
- oneI just share my good mood! ;) - vv2cc
- thanks for the code I could do 1 program I would put + but I just have reputation 1 - harry
|