Batch file call sub-batch file to pass n paramenters and return without use of file

后端 未结 3 1211
死守一世寂寞
死守一世寂寞 2020-12-13 09:29

I looking for a way using windows batch file that call sub-batch file which pass 1-9 parameters and return value (string) without the need of saving the return value into fi

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 09:57

    You're missing a couple things:

    • Use backticks not single quotes.
    • add usebackq inside the double quotes with the tokens command.

    This character ` not this character '

    On an american english keyboard, the backtick is shift-tilde, which is usually to the left of the 1 in the number row.

    @FOR /F "usebackq tokens=*" %%i IN (`%find_OS_version%`) DO SET OS_VER=%%i

提交回复
热议问题