My batch script is used to process a list of strings and I would like to parameterize it so it will accept this list as a parameter from the user.
This is how my code is processing this list currently:
set QUEUES=cars plans others
FOR %%q IN (%QUEUES%) DO Call :defineQueues %%q
How should I pass this list to the QUEUES
varibale as a parameter?
For example, how should I pass it to this script:
myScript.bat ?
You have to enclose your string with quotes:
myScript.bat "cars plans others"
Then %1
will be equals to "cars plans others"
Or %~1%
to remove the quotes and only get cars plans others
Otherwise, you will get 3 different parameter values:
myScript.bat cars plans others
%1 => cars
%2 => plans
%3 => others
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With