简体   繁体   English

从批处理文件中以静默方式运行带有参数的exe

[英]run exe with parameters silently from batch file

I want to execute an executable along with it's parameters from a Batch file silently without printing anything on the console from the executable and the executable shouldn't be executed from another console( it shouldn't open another command-prompt to execute). 我想以静默方式从批处理文件中执行一个可执行文件及其参数,而不用从可执行文件在控制台上打印任何内容,并且不应从另一个控制台执行该可执行文件( 它不应该打开另一个命令提示符来执行)。 For that I tried with start command as following and couldn't execute it. 为此,我尝试使用以下启动命令,但无法执行它。

start "C:\myApp.exe -mode='a' -inputFilePath='%filePath%'" -i silent

Where %filePath% is a variable and -mode , -inputFilePath are the arguments to my executable. 其中%filePath%是变量, -mode-inputFilePath是我的可执行文件的参数。

Please correct me for anything wrong in above statement and help me out in this. 如果上述声明有任何错误,请纠正我,并为此提供帮助。 Thanks! 谢谢!

From your batch file, just execute the following: 在批处理文件中,只需执行以下命令:

C:\myApp.exe -mode='a' -inputFilePath='%filePath%' >NUL

the >NUL redirects the output to nothing for that command. > NUL会将输出重定向到该命令的任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM