Wait for BAT command to be executed to continue

1

I need to run a bat file with the following content:

ECHO "Mensagem 1"
copy xxx yyy
ECHO "Mensagem 2"
outro.bat param1
ECHO "Mensagem 3"
copy zzz ooo

But when he runs the other.bat my script does not wait for it to finish to execute message 3 and the copy command.

    
asked by anonymous 31.05.2017 / 19:33

3 answers

2

To perform the synchronous execution in a bat file, I used the CALL

Ex:

ECHO "Mensagem 1"
copy xxx yyy
ECHO "Mensagem 2"
call outro.bat param1 > log
ECHO "Mensagem 3"
copy zzz ooo 
    
31.05.2017 / 20:53
0

Attempts to use a timeout (pause in execution) to proceed with the script.

timeout / t 60

In the above case, you will have a 60 second count to continue with the execution.

    
31.05.2017 / 19:40
0

Can be used also: cmd /c outro.bat param1 > log

    
25.11.2018 / 17:48