Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I need help with a batch file. I will shorten it and only show one of my switches, but I have a question. I was told that this batch file would loop and would probably continue to delete and rename the files on its own because the switch was never reset. Can someone give me some advice on "IF" this would happen and what I should do to stop it? Thanks in advance!
@ECHO OFF
:BEGIN
CLS
TYPE C:\SASIXP\ALLMENU.TXT
SET /P LIST= %
IF "%LIST%"=="04" GOTO AGASSIZ
IF "%LIST%"=="06" GOTO BEN
IF "%LIST%"=="05" GOTO DISCOVERY
IF "%LIST%"=="52" GOTO NORTH
IF "%LIST%"=="53" GOTO SOUTH
IF "%LIST%"=="54" GOTO WOODROW
IF "%LIST%"=="28" GOTO BENNETT
IF "%LIST%"=="23" GOTO CARL
IF "%LIST%"=="27" GOTO CENTENNIAL
IF "%LIST%"=="24" GOTO CLARA
IF "%LIST%"=="31" GOTO EAGLES
IF "%LIST%"=="22" GOTO HAWTHORNE
IF "%LIST%"=="12" GOTO HORACE
IF "%LIST%"=="21" GOTO JEFFERSON
IF "%LIST%"=="25" GOTO LEWIS
IF "%LIST%"=="26" GOTO LINCOLN
IF "%LIST%"=="18" GOTO LONGFELLOW
IF "%LIST%"=="14" GOTO MADISON
IF "%LIST%"=="17" GOTO MCKINLEY
IF "%LIST%"=="13" GOTO ROOSEVELT
IF "%LIST%"=="16" GOTO WASHINGTON
IF "%LIST%"=="44" GOTO DISTRICT
IF "%LIST%"=="333" GOTO HOME
IF "%LIST%"=="TEST" GOTO TEST
IF "%LIST%"=="test" GOTO TEST
IF "%LIST%"=="Test" GOTO TEST
IF "%LIST%"=="q" GOTO CLOSE
IF "%LIST%"=="Q" GOTO CLOSEGOTO ERROR
:AGASSIZ
DEL /Q C:\SASIXP\RDBMS.INI
DEL /Q C:\SASIXP\SASIXP.INI
COPY /Y C:\SASIXP\RDBMS\AGASSIZRDBMS.INI C:\SASIXP
COPY /Y C:\SASIXP\SASIXPINI\AGASSIZSASIXP.INI C:\SASIXP
REN C:\SASIXP\AGASSIZRDBMS.INI RDBMS.INI
REN C:\SASIXP\AGASSIZSASIXP.INI SASIXP.INI
START /MAX C:\SASIXP\SASIXP.exe /Prefetch:1
GOTO END:ERROR
CLS
TYPE C:\SASIXP\ERROR.TXT
PAUSE
GOTO BEGIN:END
GOTO BEGIN:CLOSE
EXIT

Your script looks quite cumbersome, but it seems to be fine. I do not see any reason it enters a loop as the %LIST% variable is set to a new value by the Set /P LIST= (% is no meaning).
Mark.UK tip does not pertain to batch scripts but is aimed to BASIC code.
By the way coding If /I "%LIST%"=="string" ignores lowercase/uppercase sensitivity.

![]() |
Replacement for Norton Ut...
|
Problematic Spyware/virus
|

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