从巡航控制执行ms dos批处理脚本并传递变量

时间:2021-05-21 23:32:48

I am trying to execute a msdos batch script from cruise control and pass some variables. I can execute the batch script fine but I can't access the environment variables in the batch script. Here's what my ccnet config file has:

我试图从巡航控制执行msdos批处理脚本并传递一些变量。我可以很好地执行批处理脚本,但我无法访问批处理脚本中的环境变量。这是我的ccnet配置文件:

<exec>
        <executable>myscript.BAT</executable>
        <environment>
            <variable name="var1" value="value1" />
            <variable name="var2" value="value2" />
        </environment>
</exec>

How can I access var1 and var2 in myscript.BAT? All I get when I do "%var1%" is blank.

如何在myscript.BAT中访问var1和var2?当我执行“%var1%”时,我得到的只是空白。

1 个解决方案

#1


0  

You can also pass in your values as parameters and reference var1 and var2 by $1 and $2 respectively.

您还可以将值作为参数传递,并分别将$ 1和$ 2引用为var1和var2。

#1


0  

You can also pass in your values as parameters and reference var1 and var2 by $1 and $2 respectively.

您还可以将值作为参数传递,并分别将$ 1和$ 2引用为var1和var2。