Saved Bookmarks
| 1. |
Solve : create a menu in dos? |
|
Answer» I need to create a menu in DOS that looks like the following: I need to create a menu in DOS that looks like the following: How would you "exit" DOS to windows?How do you "welcome yourself to the program"? ECHO OFF :START ECHO Menu of Options &&ECHO 1. Display all System Files &&ECHO 2. Welcome yourself to the program &&ECHO 3. Display System Information &&ECHO 4. Display Menu Files &&ECHO 5. Exit back to Windows SET /p CHOICE= IF '%CHOICE%' =='1' GOTO ONE IF '%CHOICE%' =='2' GOTO TWO IF '%CHOICE%' =='3' GOTO THREE IF '%CHOICE%' =='4' GOTO FOUR IF '%CHOICE%' =='5' GOTO FIVE GOTO :ERROR :ONE ECHO You hit One! AWESOME... GOTO END :TWO ECHO You hit Two! AWESOME... GOTO END :THREE ECHO You hit THREE! AWESOME... GOTO END :FOUR ECHO You hit Four! AWESOME... GOTO END :FIVE ECHO You hit Five! AWESOME... GOTO END :ERROR ECHO Invalid Number... :END very good... but why the double ampersands? (This isn't Unix) what should be in place of double ampersands? Quote from: Brian223 on December 06, 2010, 08:25:23 PM what should be in place of double ampersands? Single ones. Hello Salmon, Are you able to show me how to create a menu in UNIX? I need it to look like this: Menu of Options 1. Display all users in the UNIX system 2. Welcome yourself to the program 3. Display System information 4. Exit back to Windows This is your homework, right? And... Quote 4. Exit back to Windows From Unix? Really? You went from dos to unix??? Tell your teacher to stay consistent. Yes this is my homework and may get a bad grade just don't understand. THANKS to all who helped Quote from: Salmon Trout on December 06, 2010, 03:40:16 PM very good... but why the double ampersands? (This isn't Unix) The double ampersand means if the first one succeed then run the SECOND command. A single ampersand means run the second command even if the first one fails. I usually use two but in this case it could be overkill. Quote from: realgravy on December 08, 2010, 11:57:10 AM The double ampersand means if the first one succeed then run the second command. A single ampersand means run the second command even if the first one fails. I usually use two but in this case it could be overkill. I know what a double ampersand does in Windows NT family command scripts. I cannot SEE the point of USING them after ECHO commands. Quote from: realgravy on December 08, 2010, 11:57:10 AM I usually use two Ahh... Cargo Cult programming.I have from time to time come across code where the writer APPARENTLY wants to "make sure" that something happens (or doesn't happen)... A sort of belt-and-braces approach (braces are what N.Americans call "suspenders") - I think I might have read an article about this on Stack Overflow |
|