Below is given a snippet from a lengthy batch. In this snippet a user is expected to enter batch arguments in a simple one line sequence without further questions asked. However, it works only when each argument is represented by one value. How to make it work for an argument represented by several values, such as random device ID sequence 1,3,5,9,15 all to be considered as one "value" array? In particular how to enter the next argument after such sequence?
Code: Select all
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set "mes24=Do you want to enter batch arguments? Y/N"
set "mes25=Batch arguments (examples: s n y / t n / o 5 y / e 1 3) "
if "%1"=="" (
choice /c yn /n /m "%mes24%" /t 10 /d n
if !errorlevel! equ 1 (
echo/ & set /p "camn=%mes25% > "
if defined camn ("%~f0" !camn!)))
For example, I want to enter 3 argument groups: (e), (1 3 5 20), (y). How to do it in that sequence without making the code more complex?