I wrote a batch file to launch an application (the application is not mine, I cannot modify it). The batch file itself accepts some parameters. The application accepts other parameters. The batch file consumes all of its options, using SHIFT, then launch the application with the correct environment and pass the remaining parameters to the application. Example of calling the batch file:
script.bat -opt-1 -opt-2 /opt-a /opt-b=value
In the example, "-opt-1" and "-opt-2" are consumed by script.bat. At the end, it must call the original application with the parameters "/opt-a" and "/opt-b=value". The "=" sign in the last parameter is expected by the application, I cannot change it. It works well when I call the application directly from the command line.
But when I call it from the script, the application receives 2 parameters for "/opt-b=value": both "/opt-b" and "value". If I use "%*" when I call the application, the "=" signs are preserved, but all parameters are passed (including the parameters skipped using SHIFT).
Is there any way to pass only the last parameters and preserve "=" signs?