Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello all
I have been working on changing menu display
with on this batch file.I found this open source batch file online.
The only thing I want to change is the
display of those menus.
as currently it get display as in the
attached picture.http://xs132.xs.to/xs132/08413/batc...
I would like them to be in order
1. Home
2. School
3 Exit
and so on, as it will make it easy to
understand and use.I tried to make so many changes to get it to
work the way I wanted
but no luck :(Kindly requesting assistance.
Batch file
==========================================
@echo off
title Eric Burcham's IP Configuration Batch
File - 2005
setlocal
set OK=N:again
set /p choice=Please enter 1[Home],
2[School] or END ??
if /i [%choice%]==[END] endlocal&goto
end
if [%choice%]==[] goto again
if [%choice%]==[1] goto 1
if [%choice%]==[2] goto 2
set /p xxx=wrong entry, press any key to
exit.
endlocal
goto end:1
echo NIC setting for Home being
configured.....
@netsh exec home.txt
set /p see=IP changed successfully to
Home Settings [9]see new setting
[Enter]exit...
if [%see%]==[9] goto show
echo Ending IP Configuration
goto end:2
echo NIC setting for School being
configured.....
@netsh exec school.txt
set /p see=IP changed successfully to
School Settings [9]see new setting
[Enter]exit...
if [%see%]==[9] goto show
echo Ending IP Configuration
goto end:show
@netsh int ip show config:end
@echo on
cls==========================================

This is an easy fix.
Replace the top section with this
:again
echo 1. Home
echo 2. School
echo 3. End
set /p choice=
if [%choice%]==[] goto again
if [%choice%]==[1] goto 1
if [%choice%]==[2] goto 2
if [%choice%]==[3] goto end
goto againThis will write each option to it's own line, and if 1, 2, or 3 isn't entered it will ask again.
Let me know how it works, haven't helped to many people here but this was simple.

omg .. it did work :) Thanks a lot you saved
me lots of trouble.I truly thank you, I took batch file crash course back in college and I watched batch files training videos .. but sometime there are those simple things will annoy you ..
anyways.. Thanks again :D

glad I could help.
This is one of those types of examples i keep a copy of and paste it in when I need to make a selection.
in fact I'll add this to my how to tutorial.

FWIW you can simplify your code:
[1] no need to endlocal before exit; it ends by itself
[2] same goes for echo on
[3] instead of multiple IF tests, try something like:
=========================================
@echo off
setLocal EnableDelayedExpansionecho 1 do this
echo 2 do that
echo ENTER to quitset /p c= pick one
if !c!'==' goto :eof
goto :!c!:1
echo here's 1
goto :eof:2
echo here's 2
goto :eof
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |