How to avoid split by equal sign in batch

Viewed 451

How to get not splited by the equal sign attributes inside batch script?

For example:

script.bat option1 -DpropertyName_1="propertyValue_1" -DpropertyName_2="propertyValue_2" -DpropertyName_n="propertyValue_n"

My script.bat

if ""%1""==""option1"" goto setJavaOpts
if ""%1""==""option2"" goto doneSetJavaOpts

:setJavaOpts
shift
if ""%1""=="""" goto doneSetJavaOpts
set JAVA_OPTS=%JAVA_OPTS% %1
goto setJavaOpts
:doneSetJavaOpts
0 Answers
Related