How to convert argument list to skip first argument?
Button param "%T" "%S"
%* = "C:\7-Zip Test" "File&Test 1.txt" "File&Test 2.txt" "File&Test 3.txt"
After conversion, this should be the argument list
%filelist% = "File&Test 1.txt" "File&Test 2.txt" "File&Test 3.txt"
Please help
How to convert argument list to skip first argument?
Moderators: Hacker, petermad, Stefan2, white
Re: How to convert argument list to skip first argument?
I'm assuming you're talking about CMD/batch parameters. %* always returns all parameters that were passed to the script/goto target. That doesn't change if parameters are shifted with Instead parameters %2 and following need to be used. You can do it like this:Note the correct quotation: beginning it before the variable name and ending it at the end of the line ensures that parameters that contain brackets/parentheses don't screw things up - all while not adding any quotes to the filelist variable. These quotes can be left out if each individual parameter is quoted correctly. All of this assumes that there are not more than 9 parameters in total - which %* would provide but %10 doesn't exist.
HTH
Regards
Dalai
Code: Select all
shift /1
Code: Select all
set "filelist=%2 %3 %4 %5 %6 %7 %8 %9"
HTH
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: How to convert argument list to skip first argument?
2PiotrMPPL
And why did you need to create a variable with a string list of names, given the length limit?
Can you make a full-fledged request of what should happen when the button is pressed?
And why did you need to create a variable with a string list of names, given the length limit?
Can you make a full-fledged request of what should happen when the button is pressed?
Overquoting is evil! 👎