如何通过传递使用单一的bat文件动态参数来运行一个exe文件 [英] How to run one exe by passing dynamic parameters using single bat file

查看:887
本文介绍了如何通过传递使用单一的bat文件动态参数来运行一个exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要运行一个EXE的要求。这将需要7个参数外面一个参数是动态的。可能有人帮助我如何用bat文件传递动态参数来运行EXE。

I have an requirement to run one EXE. It will take 7 parameters out of which one parameter is dynamic. Could some one help me how to run the EXE by passing dynamic parameters using bat file.

谢谢
切塔尼亚

Thanks Chaitanya

推荐答案

如果你需要,你可以用参数的动态数执行命令%*

If you need to execute a command with a dynamic number of parameters you can use %*.

foo.exe [options] <file1> <file2> ...

假设你想有一个批处理脚本,设置一些选项,但仍通过文件的动态数

Say you wanted to have a batch script which sets some options but still passes a dynamic number of files

@ECHO OFF;
foo.exe -some -option %*

运行:

foo.bat FILE1.TXT FILE2.TXT

语句:

foo.exe -some -option file1.txt file2.txt

这篇关于如何通过传递使用单一的bat文件动态参数来运行一个exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆