I
I
irishmann2019-04-17 10:17:16
cmd/bat
irishmann, 2019-04-17 10:17:16

How to ignore the dialog and move on to the next command?

I form and execute a batch file, then I analyze the output files. Code example:

C:\someprogram.exe -someindex somefile.txt > some_resultfile.txt
C:\someprogram.exe -someindex somefile_2.txt > some_resultfile_2.txt
...
C:\someprogram.exe -someindex somefile_n.txt > some_resultfile_n.txt

There can be many such commands.
At runtime, some of them may display an error and a question that needs to be answered. I cannot give an answer. The batch file is stopped, the program that launched it continues to wait for execution.
How can I make a batch file so that ignoring the dialog, the next command starts to be executed?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
res2001, 2019-04-17
@irishmann

someprogram.exe - console?
If errors and questions are output to the console, and the answer is waiting on stdin, then the answers to the questions can be written to a text file (for example, answer.txt) and redirected instead of the standard input:
If someprogram.exe is a graphical utility and questions arise in their windows, then it is much more complicated, but there is the same way out - you need to use utilities like nircmd or autoit, so that with their help enter information into the windows that appear or press some buttons. These utilities are able to emulate user actions, all this is done by appropriate scripts.

S
sergey, 2019-04-17
kuzmin @sergueik

autoit will help - they even have an IDE
autoit-script.ru/index.php

O
Olgeir, 2019-04-17
@Olgeir

The short answer is no. If the program does not allow you to skip dialogs, then the batch file will not be able to do anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question