Batch Script: Start program and wait until it is finished
Question by Sledge | Last update on 2021-04-06 | Created on 2012-08-05
I need a batch script for Windows, with which I can start a program. Certainly, the next line in the script, should only be performed after the first program has been terminated.
Until now, I am using the following batch script to start two programs in succession:
@echo off program1.exe parameter1 parameter2 program2.exe parameter1 parameter2
However, this starts the programs directly after each other. Instead, the script should start the second program only after the first one is finished. Can I achieve this somehow?
Related Topics
Windows Batch Script: Computer Shutdown
Tutorial | 2 Comments
Delphi/Lazarus: Command Line Parameter Tutorial Part 1: Sending
Tutorial | 0 Comments
Put Windows via Script into Hibernation or Sleep Mode
Tutorial | 0 Comments
jQuery: Send HTML5 Canvas to Server via Ajax
Tutorial | 0 Comments
jQuery: Submit complete form and receive content with Ajax
Tutorial | 0 Comments
Windows: How to run a Program as Administrator - Once, Always or with Shortcut
Tutorial | 0 Comments
Windows: How to make Hibernation available
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Yes, you can. Just rewrite your script in this way:
With "start /wait", you start the program and wait for the program until it has been executed and terminated again. Only after that, the next line of the batch script will be processed.
Last update on 2021-04-06 | Created on 2012-08-06
@echo off
programm1.exe parameter1 parameter2 | pause
programm2.exe parameter1 parameter2
2021-04-04 at 21:33