Q:

How can I specify a list of comma delimited integers and have batch script loop for each integer?

I currently have a batch script where I use "set /p =".  Once the variable is entered, the script performs 3 robocopy commands, using the  above.  After the 3 robocopy commands finish, I use another "set /p again=" to ask if the user needs to run this again.  Sometimes this script needs to run against 10-15 integers.
Is there a way to give a list of integers, comma delimited or otherwise, and have the script loop back for each subsequent integer?
@echo off
:again
echo This script will download incident data in 2 steps.
echo Step 1 will attempt to download any previously archived data from your home drive.
echo Step 2 will attempt to download any files from the Live Incident folder.
set /p incident=Please enter the Incident Number:
robocopy "\\server1\share\%incident%" "C:\local-path\%incident%" *.* /ETA /MOV /E /R:1 /W:1 /MT:3
robocopy "\\server2\share\%incident%" "C:\local-path\%incident%" *.* /ETA /E /R:1 /W:1 /MT:2
robocopy "\\server3\share\%incident%" "C:\local-path\%incident%" *.* /ETA /E /R:1 /W:1 /MT:2
set /p again=Do you have another Incident you would like to try?
if /i "%again:~,1%" EQU "Y" goto again
if /i "%again:~,1%" EQU "N" exit /b

A:

@echo off
:again
echo This script will download incident data in 2 steps.
echo Step 1 will attempt to download any previously archived data from your home drive.
echo Step 2 will attempt to download any files from the Live Incident folder.

set /p "incidents=Please enter the Incident Numbers separated by a comma:"

For %%I in (%Incidents%) Do Call :Process %%I
CHOICE /C YN /M "Do you have another Incident you would like to try?"
If %ErrorLevel% Equ 1 Goto :again
Goto :Eof

:Process %1
:: you might do a range check on the Incident no. %1
Echo Processing Incedent # %1
:: while testing 
goto :Eof
robocopy "\\server1\share\%1" "C:\local-path\%casenum%" *.* /ETA /MOV /E /R:1 /W:1 /MT:3
robocopy "\\server2\share\%1" "C:\local-path\%casenum%" *.* /ETA      /E /R:1 /W:1 /MT:2
robocopy "\\server3\share\%1" "C:\local-path\%casenum%" *.* /ETA      /E /R:1 /W:1 /MT:2
Goto :Eof

If the output seems ok remove the goto :eof following :: while testing

