How to pass more than 9 parameters to batch file

后端 未结 11 1466
花落未央
花落未央 2020-12-17 18:08

How can I pass more than nine parameters to bach file.
I tried another SO question How do you utilize more than 9 arguments when calling a label in a CMD batch-script?

11条回答
  •  一整个雨季
    2020-12-17 18:56

    save the first nine args in a variable. THEN call shift multiple times and only then use the rest:

    set "v=http://example.com?firstName=%1&middleName=%2&lastName=%3&country=%4&address=%5&address2=%6&address3=%7&mobileNo=%8&landlineNo=%9"
    shift
    shift
    shift
    shift
    shift
    shift
    shift
    shift
    shift
    start iexplore %v%&emailAddress=%1&hobby1=%2&hobby2=%3&hobby3=%4&hobby4=%5&hobby5=%6
    

提交回复
热议问题