You might want to look this over, but I think I got all of them:
@ECHO OFF
setlocal enabledelayedexpansion
echo "Please enter the INDEX PRIMARY NUMBER Eg. 8590..8591 -> "
set /p RBPR=
for %%v in (C:\TEMP\*.LST) DO (
NET STOP FGRS
set n=%%~nv
REM REN C:\Telewest\civil_structure\sw3524.civ C:\Telewest\civil_structure\sw3524_OLD.civ
IF NOT EXIST %HOME%\sef\!n! MD %HOME%\sef\!n!
IF NOT EXIST %HOME%\sef\log\!n! MD %HOME%\sef\log\!n!
copy Y:\fvaz\FRAME_LOADER\FSetup\bak\IDX1\index_%RBPR%.dgn %HOME%\telewe_61\index.dgn
rem CALL Y:\fvaz\FRAME_LOADER\FSetup\bak\%WKSET%.BAT
IF /I %RBPR%==8590 SET CSN=SW3524.CIV
IF /I %RBPR%==8591 SET CSN=SW3525.CIV
IF /I %RBPR%==8592 SET CSN=SW3526.CIV
IF /I %RBPR%==8593 SET CSN=SW3624.CIV
IF /I %RBPR%==8594 SET CSN=SW3626.CIV
IF /I %RBPR%==8595 SET CSN=SW3723.CIV
IF /I %RBPR%==8596 SET CSN=SW3724.CIV
IF /I %RBPR%==8597 SET CSN=SW3725.CIV
IF /I %RBPR%==8598 SET CSN=SW3726.CIV
IF /I %RBPR%==8599 SET CSN=SW3727.CIV
IF /I %RBPR%==8600 SET CSN=SW3823.CIV
IF /I %RBPR%==8601 SET CSN=SW3824.CIV
IF /I %RBPR%==8602 SET CSN=SW3825.CIV
IF /I %RBPR%==8603 SET CSN=SW3826.CIV
CALL SET CSN1=%CSN%
ECHO !CSN!
!CSN!
ECHO !CSN!
SET >1234.LST
TYPE 1234.LST
PAUSE
)
Within a
for loop, you need to use the
setlocal enabledelayedexpansion statement, and reference variables set within the loop with ! doodads instead of % marks.
Hope this helps.
![Cool 8)](https://www.computerhope.com/forum/Smileys/classic/cool.gif)