I want to invoke a batch file(tomcat’s startup.bat) by passing a command line argument something like c:>startup.bat -Dsun.lang.ClassLoader.allowArraySyntax=true
But the “=” symbol is being replaced with a space.
If I put c:>startup.bat -D”sun.lang.ClassLoader.allowArraySyntax=true” the value was not set properly.
I am using Windows 7.
Is there anyway to pass command line arguments containing “=”?
Thanks,
Siva
You can’t do much about it inside the batch file, except change
%1to%1=%2, which only works if you know exactly how many parameters you’re passing in, or you know they will always come in pairs. (I suppose you could loop and put together all of the-Dxxxparameters with the next parameter, and put those without a leading-D, but if you have other=-style parameters it can get really messy.)But you can do something outside the batch file, by putting your parameter in quotes: