EDITED 27/7/2014
PLEASE READ CAREFULLY AS MY QUESTION IS A BIT COMPLICATED
Hi, I wanted to do a coding whereby it involves a JAVA GUI, batch
Change this line:
if %choices% equ 6 set choices=1,2,3,4,5
by this one:
if "%choices:6=%" neq "%choices%" set choices=1,2,3,4,5
I also suggest you to use arrays.
EDIT: Example added
@echo off
:getOptions
set "choices="
set /P "choices=Choices: "
if not defined choices goto :EOF
if "%choices:6=%" neq "%choices%" set choices=1,2,3,4,5,6
echo Execute: %choices%
goto getOptions
Example output:
C:\> test.bat
Choices: 1,3,5
Execute: 1,3,5
Choices: 1,2,4,6
Execute: 1,2,3,4,5,6
Choices: 1,6
Execute: 1,2,3,4,5,6
Choices:
EDIT: I obviously made the error of also include 6 in the replacement, but you get the point!