从命令行执行exe命令行后应该等待exe的完成 [英] After Executing a exe from command line command line should wait for the completion of exe

查看:1337
本文介绍了从命令行执行exe命令行后应该等待exe的完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可执行文件,其中提供了一些命令行选项,以静默模式运行它。
但是当我从命令行选项中运行可执行文件时,它没有等待可执行文件的完成。

I have a executable in which some command line options are provided to run it in a silent mode. But when i run the executable from the command prompt with command line options it didn't wait for the completion of executable.

我希望它应该等待以完成exe的执行。

I want that it should wait for the completion of execution of exe.

我不想在命令提示符中添加任何其他参数。
我想在可执行文件中处理。

I don't want to add any other parameter in command prompt. I want to handle this in executable.

任何人都可以帮助?

推荐答案

您要求的内容不能在可执行文件中处理。控制台正在启动可执行文件,而不是等待它退出。这是一个控制台问题,而不是可执行问题。您需要使用控制台的 start 命令运行可执行文件,以便可以使用命令的 / wait 参数:

What you are asking for cannot be handled in the executable. The console is launching the executable and not waiting for it to exit. That is a console issue, not an executable issue. You need to use the console's start command to run the executable so you can use the command's /wait parameter:

start /wait myapp.exe /silent

或者使用批处理文件来运行可执行文件,然后让控制台运行批处理文件。批处理文件等待每个命令完成,并且控制台等待批处理文件完成。

Or else use a batch file to run your executable, and then have the console run the batch file. A batch file waits for each command to complete, and the console waits for a batch file to complete.

这篇关于从命令行执行exe命令行后应该等待exe的完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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