简体   繁体   中英

After Executing a exe from command line command line should wait for the completion of 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.

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.

Can anyone help?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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